borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Vb.net & ASP.NET Free Ebook)Next Topic (Printing Listbox in VB.net) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : declare textbox from another form to another form Solved Topic
Poster Message
eira_ak
Level: Protégé

Registered: 08-03-2007
Posts: 8

icon declare textbox from another form to another form

i've made a program..
i create a form with 2 textbox..then i want to call the input
to another form..but its error when it said the textbox is not declared..
how can i declare the textbox from another form?

13-03-2007 at 05:12 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
lbuntha
Level: Scholar

Registered: 05-05-2006
Posts: 39
icon Re: declare textbox from another form to another form

I don know what language you are using (C# or Vb.net). But I want tell you if you are using C#, it requires you declare public modifier.
example:
Form1
public TextBox txt1=new TextBox;
public TextBox txt2=new TextBox;
___________________________________________
Form2
you can call all input in the form1 to the form2.
private TextBox txt3=new TextBox;
private TextBox txt4=new TextBox;
txt3.Text=form1.txt1.Text;
txt4.Text=form1.txt2.Text;

--------------------------------------
Thanks and best regards!



  

____________________________
ly buntha

15-03-2007 at 04:46 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
eira_ak
Level: Protégé

Registered: 08-03-2007
Posts: 8
icon Re: declare textbox from another form to another form

thanks..but i'm using vb.net..
how to rite the code ya?

15-03-2007 at 04:57 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
eira_ak
Level: Protégé

Registered: 08-03-2007
Posts: 8
icon Re: declare textbox from another form to another form

actually the output will be display in label text..
from txtbox from another form to the label..

15-03-2007 at 05:00 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
TBryce311
Level: Protégé

Registered: 20-03-2007
Posts: 6
icon Re: declare textbox from another form to another form

quote:
eira_ak wrote:
i've made a program..
i create a form with 2 textbox..then i want to call the input
to another form..but its error when it said the textbox is not declared..
how can i declare the textbox from another form?


lets say you have form1 with txtbox1 and txtbox2
then form2 wants their input

form2 does not know anything about form1 and the objects it has.  You have to tell form2 where to find the textbox by calling the class before the textbox.

dim i, j as string = ""

i = form1.txtbox1.text
j = form1.txtbox2.text

[Edited by TBryce311 on 20-03-2007 at 01:59 PM GMT]
20-03-2007 at 06:58 PM
View Profile Send Email to User Show All Posts | Quote Reply
eira_ak
Level: Protégé

Registered: 08-03-2007
Posts: 8
icon Re: declare textbox from another form to another form

thanx a lot ya!

06-04-2007 at 06:12 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB.Net : declare textbox from another form to another form Solved Topic
Previous Topic (Vb.net & ASP.NET Free Ebook)Next Topic (Printing Listbox in VB.net) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder