adding background image to form(windows mobile)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • libish
    New Member
    • Oct 2008
    • 42

    adding background image to form(windows mobile)

    hi all..,
    i'm new in windows mobile application...
    i would like to kno if there exist any way to add a background image to "form"(wind ows mobile).
    thanks in advance..
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Have you searched MSDN?

    Comment

    • libish
      New Member
      • Oct 2008
      • 42

      #3
      Originally posted by RedSon
      Have you searched MSDN?

      yes i've searched msdn... there i found adding background image to buttons and all..
      but what i need is to add a background image to "form" this i couldnt find..

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by libish
        yes i've searched msdn... there i found adding background image to buttons and all..
        but what i need is to add a background image to "form" this i couldnt find..
        Well a button is technically a window so maybe you can try using the same strategy. What did you find on it?

        Comment

        • LTCCTL
          New Member
          • Feb 2008
          • 49

          #5
          Hi,

          You can add a picture box to the form, add image and set the dock property to fill, you can also use the property SizeMode as StretchImage.


          hope this will help


          Regards
          LTCCTL

          Comment

          • libish
            New Member
            • Oct 2008
            • 42

            #6
            hi all...
            thanks for your reply.

            i got a form, by default there is no background image. here i want to add an image as background, and top of this image i want some text box some buttons etc...

            if i add an image in picture box, then i wont be able to add text boxes and buttons on top of it... that is why i'm in search of what i'm searching.

            Comment

            • markmcgookin
              Recognized Expert Contributor
              • Dec 2006
              • 648

              #7
              Originally posted by libish
              hi all...
              thanks for your reply.

              i got a form, by default there is no background image. here i want to add an image as background, and top of this image i want some text box some buttons etc...

              if i add an image in picture box, then i wont be able to add text boxes and buttons on top of it... that is why i'm in search of what i'm searching.
              Yes you can, but in theory the buttons etc would be sitting on the picture box wouldn't they?

              Can you not use Visual Studio's "Bring to Front" option on your textboxes to move them in front of the picture box?

              Comment

              • libish
                New Member
                • Oct 2008
                • 42

                #8
                Originally posted by markmcgookin
                Yes you can, but in theory the buttons etc would be sitting on the picture box wouldn't they?

                Can you not use Visual Studio's "Bring to Front" option on your textboxes to move them in front of the picture box?



                thank you soo much for that suggestion....
                it works...

                Comment

                • StokesWare

                  #9
                  I know this thread is is kinda old but just for the people still looking for it.

                  The above solution is what i used to use but its anoying to keep setting every control to the front one by one, and also while filling youre window it can be anoying not to select the form on an empty piece of form.

                  so here is the solution i came up with.

                  Code:
                  protected override void OnPaintBackground(PaintEventArgs e)
                          {
                              base.OnPaintBackground(e);
                              e.Graphics.DrawImage(YoureGraphicOrBitmapHere, 0, 0);
                          }
                  The above will draw youre background in youre window and makes it not clickable.

                  Comment

                  Working...