Hey, i have a Command Button Control that i have Created. I would like to know how to Add a Propertie so i can Add Text like the Normal Command Button. I've Searched loads of Places but not really got anywhere
Cheers - L3mmy
Printable View
Hey, i have a Command Button Control that i have Created. I would like to know how to Add a Propertie so i can Add Text like the Normal Command Button. I've Searched loads of Places but not really got anywhere
Cheers - L3mmy
ok i can help you build properties...
heres the steps(for your case, but is these way that you will build a new propertyies):
1-you must declare the variable in usercontrol Declaration section:
2-Lets create the property "Caption":Code:dim strCaption as string
know you can put these property in property(for be persistent):Code:Public Property Get Caption() As string
'here is for get the text
Caption=strCaption
End Property
Public Property Let Caption(ByVal vNewValue As string)
'here is for change the text
strCaption=vnewvalue
command1.caption=strCaption
PropertyChanged "Caption"
End Property
i hope help you...Code:Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
text=PropBag.ReadProperty("Caption", "")
end sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Caption", Caption, ""
end sub
I Should probably say that i am doing this in Visual Basic 2005.
Get/Set/Let are no Longer Supported :(
L3mmy.
i'm sorry, but what version are you using?Quote:
Originally Posted by L3mmy
these code is for VB6, but if you need in VB2005 you can translate the code by using 1 option(i don't remenber the option name, i'm sorry)...
i hope help...
It's VB2005 Express..It's what i use to Develop my Apps for my Company.
ok... but don't forget that you can translate my vb6 code by using an option for translate/update the code... i'm using visual basic 6, i'm new in visual basic 2005....Quote:
Originally Posted by L3mmy
stay well
No means to soind like a noob. But i havn't used this Function/Command. Where can i find it? :)
- L3mmy
"No means to soind like a noob."- i don't understand why you said these... i'm sorry, i'm portuguese...Quote:
Originally Posted by L3mmy
if i'm not round in Tools menu, go see if theres is something like "update vb6 code", something like these...
tell me if i'm right...