locked
VS2008.Net3.5CF:Adding an Image to a button programmetically RRS feed

  • Question

  • Hi: I see that there is not an image attribute for the Button control in VS2008.Net3.5CF,SDK2. How can I add an image to a button in my form by code?
    Wednesday, February 24, 2010 9:07 PM

Answers

  • You can either override the rendering on the current button class or make your own custom control that will behave like a button. Making your own control is usually easier. Overriding the rendering on the existing button will require that you intercept the button's message loop (Win32 native stuff).

    Helpful links:

    Creating a Compelling UI for Windows Mobile and the Microsoft .NET Compact Framework
    http://msdn.microsoft.com/en-us/library/dd630622.aspx

    How to Create a Microsoft .NET Compact Framework-based Image Button
    http://msdn.microsoft.com/en-us/library/aa446518.aspx

    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    • Marked as answer by syedripon Thursday, February 25, 2010 2:30 PM
    Wednesday, February 24, 2010 10:35 PM