|
-
May 22nd, 2004, 12:32 AM
#1
Thread Starter
Fanatic Member
NewBie .. how to use object of the other form
Dear The Expert,
With VB6 .. We can use / get the value of object from other form.. (eg. I want to get the value of textbox.text on Form1, I use Form1.Textbox1.Text) .. how about in VB.NET? .. I need to use the sqldataadapter object on Form1 .. how to do this...? please advice .. thank you
Regards
Winanjaya
-
May 22nd, 2004, 12:56 AM
#2
Lively Member
VB Code:
dim f as new form1()
dim s as string=f.textbox1.text
provided that textbox1 is a public member of form1. is this what u want? if not, sorry
-
May 22nd, 2004, 05:57 AM
#3
PowerPoster
Re: NewBie .. how to use object of the other form
Originally posted by Winanjaya
Dear The Expert,
With VB6 .. We can use / get the value of object from other form.. (eg. I want to get the value of textbox.text on Form1, I use Form1.Textbox1.Text) .. how about in VB.NET? ..
Regards
Winanjaya
Several ways. Have a search of this forum for several posts.
Easiest is in a module:
Public frm1 as New Form1
Public Sub Main
Application.run(frm1)
In Form1
Dim frm2 as New Form2
You can then access any object or method of Form1 by prefacing your code for example.
frm1.TextBox1
Last edited by taxes; May 24th, 2004 at 05:45 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
May 22nd, 2004, 08:51 AM
#4
Thread Starter
Fanatic Member
but if we use the statement below:
dim f as new form1
this will call form1 twice .. because form1 is as startup form.. any idea?
TIA
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
|