VB.net Stackoverflow Exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pwells52
    New Member
    • Mar 2006
    • 1

    #1

    VB.net Stackoverflow Exception

    :mad: I am creating an application with 6 forms and trying to send variables from one form to another. The system crashes inside the generated code at MyBase New() line. Help me please!
    Paul
  • motiee
    New Member
    • Mar 2006
    • 3

    #2
    Dear paul,
    You must use "form'sname.var iable's name" to assignment.
    In addition you shoud definition your variable's between "bublic class form1 and end class.
    for example I have 2 forms and I want use for variable in form2.vb that defined in form1.vb.

    Public Class Form1
    Public X As String = "paul"

    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
    Form2.Show()
    End Sub

    End Class

    Public Class Form2

    "And I have a textbox in form2.vb"

    Private Sub Form2_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
    TextBox1.Text = Form1.X <----"form'sname.var iable's name"
    End Sub
    End Class
    Last edited by motiee; Mar 24 '06, 04:12 PM.

    Comment

    • Winx
      New Member
      • Mar 2006
      • 5

      #3
      start your application using a Sub Main & declare the forms there as Public WithEvents. that should solve it.

      Comment

      Working...