Results 1 to 5 of 5

Thread: Control Reference

  1. #1

    Thread Starter
    Registered User
    Join Date
    Mar 2002
    Location
    Nashville, TN
    Posts
    103

    Unhappy Control Reference

    How do I reference controls on other forms in VB .NET? In VB 6.0, you could just say form.control and then you could access that forms controls. The only way I can figure out how to do this is to declare an object as that form but then I need to be able to set the object to a instance of the form if the form is loaded. Any ideas on how to handle any of this?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    for example :

    Dim frm2 as new form2
    frm2.Textbox1.Text

    Is this what you mean ?

  3. #3

    Thread Starter
    Registered User
    Join Date
    Mar 2002
    Location
    Nashville, TN
    Posts
    103
    yes but how do I force that form variable to reference an already loaded instance of the form or does that not matter (i.e. will it automatically pickup a reference to the loaded form)?

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try to declare that in second form constructor (I think it should works) or put the variables in modal like this :

    Dim frm2 as new form2

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here, read this. Should answer the question pretty well.
    http://msdn.microsoft.com/library/de...adingtonet.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width