|
-
Jun 10th, 2004, 08:54 AM
#1
Thread Starter
Member
Problem Accessing Controls from inside my custom class
I am pretty new to VB.Net and I am playing around with classes. I understand the basics but I am having a problem accessing a control on my form from within my new class.
Example:
I have a label on my main form.
I have created a new class (car)
When I call a Method in my car class to name the car I would like it to change the text property of my label.
I am not sure how to refrence the label control from my class ( I have tried Mylable.Text = "Ford") But I get an error.
I am sure I need to put in some sort of refrence back to the original control but I am not sure what to put.
Also:
I have 2 picture boxes on my Form
I am trying to store a picturebox (MyPictureBox1) as a member variable in my class.
The result I am looking for is to be able to say MyClass.Picture.Visible = True and change the state of the associated picturebox change from hidden to visible.
Thanks,
-Patrick
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
|