Aug 29th, 2008, 10:58 PM
#1
Thread Starter
Lively Member
[RESOLVED] Need Few Addition on Usercontrol.....
i have extended Listbox control below attached....... how shall i add font property & appearance property to user control
i have never worked with usercontrol plz help !!
Aug 29th, 2008, 11:08 PM
#2
Re: Need Few Addition on Usercontrol.....
Maybe this will help with the font part? Adding a Font Object to Your User Control
Aug 29th, 2008, 11:11 PM
#3
Thread Starter
Lively Member
Re: Need Few Addition on Usercontrol.....
but i have a listbox on that usercontrol...... of which i need to change font !!
Aug 29th, 2008, 11:21 PM
#4
Thread Starter
Lively Member
Re: Need Few Addition on Usercontrol.....
Code:
Public Property Get Font() As StdFont
m_Font = ListBox.Font
End Property
Public Property Let Font(ByVal NewFont As StdFont)
NewFont = m_Font
ListBox.Font = NewFont
End Property
then it says object with varible not set
Aug 30th, 2008, 12:23 AM
#5
Re: Need Few Addition on Usercontrol.....
I just slapped this together, it should allow you to set the font in design mode (and remembers the setting) as well as setting it at runtime,
i.e..@ runtime ...If Control name is UC ....
UC.Font = "Arial"
UC.FontSize = 18
UC.FontBold = True
UC.FontItalic = True
In design mode just double click/select "Font" in Properties and set.
Hope that helps.
Attached Files
Aug 30th, 2008, 01:29 AM
#6
Re: Need Few Addition on Usercontrol.....
StdFont is an object, try to use with Set keyword.
Code:
Set NewFont = m_Font
Set ListBox.Font = NewFont
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