abennett10
asked on
Controling the text property of a label control on a different form !!!!!!!
Hello all
Anytime I try and set the text property a label control on a diferent form, I get this error :
Object reference not set to an instance of an object.
Here is my code :
F1.lblRfrTime.Text = IntTime
Me.Close()
"IntTime is a string variable"
How can I resolve this quick ?
Thanks!
Anytime I try and set the text property a label control on a diferent form, I get this error :
Object reference not set to an instance of an object.
Here is my code :
F1.lblRfrTime.Text = IntTime
Me.Close()
"IntTime is a string variable"
How can I resolve this quick ?
Thanks!
What version VB.Net are you using?
ASKER
2003
You need a reference to the actual instance of the form you want to update.
What is the relationship of the forms to each other?
If "F1" created by the current form? or vice versa?
Or does something else create both instances?
What is the relationship of the forms to each other?
If "F1" created by the current form? or vice versa?
Or does something else create both instances?
you can do that by:
declare the second form in the first:
ie
dim form2 as Form2() ' by doing so you r creating an instance of the other form..
form2.label.text="sdsd"
not sure about the syntax
declare the second form in the first:
ie
dim form2 as Form2() ' by doing so you r creating an instance of the other form..
form2.label.text="sdsd"
not sure about the syntax
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.