|
-
Aug 20th, 2008, 10:03 PM
#1
Thread Starter
Member
Custom Control Property
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
uhm, it wasn't me..
Prove it..
Prove it was me........
-
Aug 22nd, 2008, 02:24 PM
#2
PowerPoster
Re: Custom Control Property
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:
Code:
dim strCaption as string
2-Lets create the property "Caption":
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
know you can put these property in property(for be persistent):
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 hope help you...
-
Aug 22nd, 2008, 02:46 PM
#3
Thread Starter
Member
Re: Custom Control Property
I Should probably say that i am doing this in Visual Basic 2005.
Get/Set/Let are no Longer Supported 
L3mmy.
uhm, it wasn't me..
Prove it..
Prove it was me........
-
Aug 22nd, 2008, 04:20 PM
#4
PowerPoster
Re: Custom Control Property
 Originally Posted by L3mmy
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?
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...
-
Aug 22nd, 2008, 06:22 PM
#5
Thread Starter
Member
Re: Custom Control Property
It's VB2005 Express..It's what i use to Develop my Apps for my Company.
uhm, it wasn't me..
Prove it..
Prove it was me........
-
Aug 22nd, 2008, 06:25 PM
#6
PowerPoster
Re: Custom Control Property
 Originally Posted by L3mmy
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....
stay well
-
Aug 22nd, 2008, 06:28 PM
#7
Thread Starter
Member
Re: Custom Control Property
No means to soind like a noob. But i havn't used this Function/Command. Where can i find it? 
- L3mmy
uhm, it wasn't me..
Prove it..
Prove it was me........
-
Aug 22nd, 2008, 06:38 PM
#8
PowerPoster
Re: Custom Control Property
 Originally Posted by L3mmy
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...
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...
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
|