Lanc1988 Posted August 9, 2006 Posted August 9, 2006 I have a program where the user can change the background image of the form. Right now I just have about 5 images they can choose and when they choose a new image it saves to a file so that when they open the program again it will load the right image for the background. I want to add a custom option so they can choose a image file but I can't figure out how to get the file path and file name from the dialog box. Quote
Leaders snarfblam Posted August 9, 2006 Leaders Posted August 9, 2006 What dialog box? The FileOpenDialog? Your own? If you are using the FileOpenDialog then you just read the FileName property. Quote [sIGPIC]e[/sIGPIC]
Lanc1988 Posted August 9, 2006 Author Posted August 9, 2006 What dialog box? The FileOpenDialog? Your own? If you are using the FileOpenDialog then you just read the FileName property. I'm using the FileOpenDialog. So the FileName property will get the the name of the file but what will get me the path for it? Quote
Lanc1988 Posted August 9, 2006 Author Posted August 9, 2006 ok, i got it all to work the way I wanted. now im trying to get the dialog box to filter but its now working, so far I have and it works fine: dialogCustomTheme.Filter = "Image Files (*.jpg)|*.jpg" But I want to have more than just jpg so I tried things like but it doesnt work: dialogCustomTheme.Filter = "Image Files (*.jpg)|*.jpg, *.bmp, *.png" Quote
*Experts* mutant Posted August 10, 2006 *Experts* Posted August 10, 2006 This example is straight from the MSDN documentation. All you have to do is in your second part of the filter separate them using the semicolon instead of a comma. Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.* Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.