Copy Textbox

.netdev

Member
Joined
Jan 7, 2006
Messages
10
Programming Experience
Beginner
DEAR ALL,
IGOT A PROB THAT MIGHT BE EASY FOR YOU GUYS

I HAVE A FORM1 WITH A TEXTBOX AND A BUTTON LEADING TO FORM2
IN FORM 2 I HAVE A TEXTBOX

I WANT WHEN I CLICK THE BUTTON OF FORM1 TO BE ABLE TO GO TO FORM 2 AND SHOW IN THE TEXTBOX OF FORM 2 THE TEXTBOX OF FORM1...

PLZ HELP ME HOW CAN I PROCEED SO....
 
one method in pseudo code:
VB.NET:
class form1
'contains textbox named form1textbox and button
dim form2 as new form2
sub button_click
  form2.settext(me.form1textbox.text)
  form2.show
end sub
end class
 
class form2
'contains textbox named form2textbox
[B]public[/B] sub settext(str as string)
  me.form2textbox.text=str
end sub
end class
 
Moved to more appropriate forum. I've moved this to the Windows Forms forum, even though it is really just a question on object-oriented principles. If you want to affect an object you must have a reference, either direct or indirect, to that object. To get data into an object you must either set a property (or field) or else pass a value as an argument to a method. You may think this sounds complicated, but just read each sentence in isolation. A reference just means a variable, and direct means that the object itself is in the variable while indirect means that the object in the variable has a reference to the object you want to affect. As for setting properties and passing arguments to methods (procedures and functions), you have no doubt been doing that already. All this means is that your first form needs a variable that either refers to the TextBox itself or an object that has a reference to it, like the form that contains it, and then you must either set it's Text property directly or call a method that will set that property.
 
Thanks for the reply

each employee record has a field called "report to" (integer of 4) and it means the id of the employee who is rsponsible of him
in my vnet form the "report to" field is a combo box of the all employee names

wut i want to know is how i can save to the database while the form contains a combo of names and how i display from the database while the database field is integer...?

got wut i mean?
 
.netdev said:
Thanks for the reply

each employee record has a field called "report to" (integer of 4) and it means the id of the employee who is rsponsible of him
in my vnet form the "report to" field is a combo box of the all employee names

wut i want to know is how i can save to the database while the form contains a combo of names and how i display from the database while the database field is integer...?

got wut i mean?
This is a completely unrelated question. Please keep each thread to one topic. This question should have been asked in a new thread. I've also already answered this question in another thread started under a different ID. Are you posting under two different IDs, or is it just coincidence that the same question has been asked by two different people in almost the exact same way, e.g. "Dear All', "Wut". We're here to help, but please use some common sense when posting.
 
Back
Top