Hi,
I am trying to have am image on the ButtonUIElement like the following:
Public Sub AfterCreateChildElements(ByVal parent As Infragistics.Win.UIElement) _
If TypeOf parent Is GroupBoxHeaderUIElement Then
btnAddProblems = ButtonUIElement(parent)
New Drawing.Size(parent.RectInsideBorders.Width - 125, parent.RectInsideBorders.Height))
btnAddProblems.Appearance.ImageBackground = img
at this point I am geetin NullException Error because btnAddProblems.Appearance is Nothing at this point
How could I resolve the probelm and and where should I write InitAppareance and how to invoke that method.
Please help.
Thanks.
You can either create this appearance property ahead of time or right before you want to assign the imagebackground. So:
btnAddProblems.Appearance = new Appearance()
btnAddProblems.Appearance.ImageBackground = img;
or:
Dim myApp as Appearance = new Appearance()
myApp.ImageBackground = img
then later:
btnAddProblems = myApp
(my syntax might not be 100%, I entered the code directly into this box)
Its not giving me any error now but still not showing the image on the button . Do we need to override InitAppearance() method or so....