|
-
October 24th, 2003, 09:23 AM
#1
What about the 'Me' in ActiveX
Hello,
I created an ActiveX control that has a user control and a form.
the problem is that I cannot figure out how to pass a reference of the user control to the form so that when I have the form displayed I can manipulate the controls on the user form.
Any ideas?
-
October 24th, 2003, 09:57 AM
#2
Not sure if I'm understanding what you need, but it sounds like you should be able to create Let/Get Properties to store this info. just like you would a class object. These properties can be manipulated in code or by going to the properties of the control itself.
-
October 24th, 2003, 10:05 AM
#3
By the way, "Me" has been fired from ActiveX and is now collecting unemployment. Just reference the controls within the ActiveX control itself.
-
October 25th, 2003, 02:05 PM
#4
That is the problem, suppose that in the project I have the usercontrol and one form. On the usercontrol I have a textbox. When the form is displayed, is it possible that I manipulate the textbox on the usercontrol just from the form.
-
October 27th, 2003, 09:25 AM
#5
I think you should be able to do something like this:
Assuming that you have created an instance of your ActiveX control as MyActiveX in your form, you could set textboxes like this:
Me.MyActiveX.Textbox1.Text = "Some Value"
Cheers,
Laurent
For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.
-
October 27th, 2003, 09:39 AM
#6
Probably I cannot explain the situation right but let me try once again.
1. Create an ActiveX control Project. At this point I have the UserControl1 control.
2. I drag a text box from the toolbox on the user control
3. On the project explorer I click on Project1, choose Add -> Form.
Now I have Form1 as well.
in the usercontrol I have the following
Private Sub UserControl_Initialize()
Form1.Show
End Sub
in the form I have
Private Sub Form_Load()
' How can I set the user control text box's text here?
End Sub
Maybe I am missing something trivial but, please, let someone put an end to this matter. Thanks.
[IMG]ftp://sdyn.pirin.com/Valeri/Sample.JPG[/IMG]
Last edited by vin; October 27th, 2003 at 09:46 AM.
-
October 27th, 2003, 10:31 AM
#7
Oops, my bad. I didn't realize that you were talking about the form embedded in your usercontrol.
What about this:
Private Sub Form_Load()
' How can I set the user control text box's text here?
Textbox1.Text = "Some Value"
End Sub
Just like rjm mentioned, just reference the controls by what they are actually called in your project.
Cheers,
Laurent
For an aviator, the three best things in life are a good landing, a good orgasm, and a good sh*t. A night carrier landing is one of the few opportunities to experience all three at the same time.
-
October 27th, 2003, 10:38 AM
#8
Not a chance,
the text1 is not a memeber of the From but of the UserControl.
That is why I wanted to pass a reference of the userControl to the form. But it seems that the 'Me' pointer is type of some class that holds all the public properties of the usercontrol but not the private members and the controls.
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
|