Set background image for windows mobile forms

I am new to Windows Mobile. I need to set a background image for a form, but I can only see the option to set the background color. Also I tried to set a background image for tab control, also I didn't see any way to set a background image. How to set a background image.

Thank,

+2


source to share


2 answers


Override OnPaint and paint your own image. Something like that:

protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);
    e.Graphics.DrawImage(myBackGroundBitmap, 0, 0);
}

      



Of course, you need to upload this image and you may want to crop, center, or scale it, but the process is really simple.

+3


source


Another "low-tech" solution is to simply place an image control on your form and use the submit back function in the form designer to provide control over any other control you have.



There is no need to write any code in this approach, and you can adjust the image scaling options, etc. via the Visual Studio Properties window.

+1


source







All Articles