|
-
Aug 24th, 2011, 07:35 PM
#1
Thread Starter
New Member
setting a picture as a backround image
Im using Visual studio 2005 and I want to push a button which opens either folderbrowserdialog or openfiledialog(which ever works better) and select a picture when I Push Ok the picture I selected becomes the backround image of the form does anybody have idea on how to do this? thanks
-
Aug 24th, 2011, 08:27 PM
#2
Re: setting a picture as a backround image
If you want to select a folder then you use a FolderBrowserDialog. If you want to select a file then you use an OpenFileDialog or SaveFileDialog, depending on whether the file is a source or a destination.
Add your Button and OpenFileDialog to the form. Handle the Click event of the Button and, in the event handler, show the OpenFileDialog. If the user clicks OK, get the FileName from the dialogue and call Image.FromFile to create an Image object, which you can then assign to the appropriate form property.
-
Aug 25th, 2011, 01:48 AM
#3
Thread Starter
New Member
Re: setting a picture as a backround image
I dont understand is the call the image.fromfile but i get everything else, thanks for the reply
-
Aug 25th, 2011, 02:09 AM
#4
Re: setting a picture as a backround image
http://www.google.com.au/search?q=im...ient=firefox-a
The first two results are the documentation, which should always be your first port of call anyway, plus there are more examples. That's you one freebie.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|