I have a Visual Studio 2015 Windows Forms program with a menu form and several others. The code for the menu button in question looks like this:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Visible = False
For i As Integer = 1 To 10
If x_DataTable.Rows(0)(i.ToString()) <> "" Then
Me.Controls(("txt" & (i)).ToString()).Text = x_DataTable.Rows(0)(i.ToString())
Dim s As String = Me.Controls(("txt" & (i)).ToString()).Text.Trim()
If Convert.ToInt32(s.Substring(s.Length - 2)) < (m_DataTable.Rows(0)("Limit")) Then
Me.Controls(("txt" & (i)).ToString()).BackColor = Color.IndianRed
Form.Load event has some odd exception handling behavior on x64 systems compared to x86 when a debugger is attached. When an exception is unhandled in a x86 process running on an x64 version of Windows the function is basically aborted, and the exception is eaten by the wow64 sub-system. Execution resumes at the last .net code on the stack before
Load was called.
See this answer for a very thorough explanation.