Let's say, that I want to make an ActiveX Control with a label, which the user can change the caption at, by typing fx. MyActiveX.Label1.Caption ="New Caption"
How is this possible???
Printable View
Let's say, that I want to make an ActiveX Control with a label, which the user can change the caption at, by typing fx. MyActiveX.Label1.Caption ="New Caption"
How is this possible???
Hi,
You need to insert a standard Label in an empty Usercontrol in order to use MyActivex.Label1.Caption="My Activex is done".
Hope this can help you.
Michel Jr.
No that's not what I mean :)
The user has to be able to change the Caption of the lable at Run-Time, when I have compiled it and distributed it etc.....
Why don't you use the Label1_Click event. When this one is triggerd then you make a textbox visible that will be on top of the label. You can't see the textbox normaly, because it's invisible. When you choose for the flat textbox it will look like the label has become white and the typing is no problem.
After that you take the textbox_Keypressed event to wait for the user to hit enter. When he does this isn't an enter in the textbox, but instead the textbox becomes invisible and you updat the label.
And what do you have. A label wich can be changed at runtime by the user. You can use the registery to save these label captions and the next you load, you have the same label in your form, but others can have there own.
I have tried to insert my ActiveX containg the Label, but I can't change it......
Hi,
You need to set up some properties inside Visual Basic Wizar. You must do a relation between the Caption and the Label of the Usercontrol. So, when you change the Caption, the Label is updated automatically.
Michel Junior
Hi!
Do you have some suggestions on how to do that?? :)
Hi,
1- Inside VB, go to Add-ins => Activex Control Interface Wizard menu.
2- Put Caption property inside the Selected Names box.
3- Click Next.
4- Click Next.
5- PUBLIC NAME MAPS TO
Caption CONTROL
Label1
MEMBER
Caption
6- Go ahead until finish it.
This procedure is to link the Caption property of the Usercontrol to the Caption property of the Label inside the Usercontrol.
This wizard menu is very useful when developing OCX. You must learn and get practice using it. It will help you a lot.
Hope this help you.
Michel Junior
Thank you very much! :) I'll try it! :)