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 !!
Printable View
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 !!
Maybe this will help with the font part? Adding a Font Object to Your User Control
but i have a listbox on that usercontrol...... of which i need to change font !!
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 :(
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.
StdFont is an object, try to use with Set keyword.
Code:Set NewFont = m_Font
Set ListBox.Font = NewFont