|
-
May 22nd, 2004, 07:31 AM
#1
Thread Starter
Fanatic Member
Using objects on different forms [Resolved]
hi,
this question should be really easy, and i dont understand why something so easy is causing me problems...
I have a form, called frmMain which starts up with the program. Now in a class called Connection.vb it does several things, and at a certain point in the class i want it to update a listbox on frmMain.
How the hell do i go about adding an item to a listbox on frmMain when im in this class?
I know about methods where u have to declare the form, like
Dim formMain as New frmMain
but the thing is, doing that will make a new instance of the form and not update the listbox on the form that is already open.
doing
Dim formMain as frmMain
won't work either, i get some error.
How do i do this? I just don't understand... without any declorations, and write frmMain. I get options like ActiveForm and don't understand...
in VB6 this was so easy, you just simply wrote frmMain.textbox1.text = "bla"
so why can't you just do something that easy in VB.NET? like
frmMain.listbox1.items.add("blah")
Thanks for the help
Last edited by LITHIA; Jul 29th, 2004 at 08:51 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|