|
-
Nov 30th, 2006, 05:37 AM
#1
Thread Starter
Fanatic Member
selectPictureDialog problem
Hi guys
I am trying to use the selectPictureDialog.
Here's the code i already have:
VB Code:
Dim selectPictureDialog As SelectPictureDialog = New SelectPictureDialog
Dim selectedFile As String
With selectPictureDialog
.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
.Filter = "JPEG (*.jpg)|*.jpg"
.FilterIndex = 1
.CameraAccess = True
.ShowDialog()
selectedFile = .FileName
'.SortOrder = SortOrder.DateAscending
End With
MsgBox("Photos shown")
Now this code is triggered every time a particular button is clicked. Now when the button is clicked all that happens is the messagebox shows. I also notice a quick flash (which i assume means it is for some reason exiting itself straight after being initialised.) Can anybody see why it is doing this and how i may be able to fix it.
Thanks in advance

Oh n i forgot to mention.....i'm using .net compact framework 2.0 Thanx.
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Nov 30th, 2006, 05:45 AM
#2
Re: selectPictureDialog problem
Outside the 'With'
VB Code:
If selectPictureDialog.ShowDialog = DialogResult.OK Then
selectedFile = .FileName
End if
MsgBox("Photos shown")
Inside should work as well but you need that conditional statement.
-
Nov 30th, 2006, 06:02 AM
#3
Re: selectPictureDialog problem
Umpf, name your dialog something else than the class, like selectPictureDialog1
-
Nov 30th, 2006, 06:04 AM
#4
Thread Starter
Fanatic Member
Re: selectPictureDialog problem
Thanks for the quick reply
I tried both inside and outside the with statement and i still get the same result....Just the messagebox shows!
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Nov 30th, 2006, 06:07 AM
#5
Thread Starter
Fanatic Member
Re: selectPictureDialog problem
Tried changing the name aswell....still no luck!
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Nov 30th, 2006, 01:34 PM
#6
Re: selectPictureDialog problem
Hi,
Here's a link where you can find some information about the selectPictureDialog;
http://search.msdn.microsoft.com/sea...siteid=0&tab=0
Hope it helps,
sparrow1
-
Nov 30th, 2006, 01:50 PM
#7
Re: selectPictureDialog problem
What type of control is "SelectPictureDialog"? I have never seen this component. Is this a custom control? a third party component?
-
Nov 30th, 2006, 01:53 PM
#8
Re: selectPictureDialog problem
 Originally Posted by VBDT
What type of control is "SelectPictureDialog"? I have never seen this component. Is this a custom control? a third party component?
Hi VBDT,
I believe that it's a component for Windows Mobile.
Wkr,
sparrow1
-
Nov 30th, 2006, 01:56 PM
#9
Re: selectPictureDialog problem
thanks sparrow1 that might be it. I have never see this component in the windows form projects.
-
Nov 30th, 2006, 02:01 PM
#10
Re: selectPictureDialog problem
 Originally Posted by VBDT
thanks sparrow1 that might be it. I have never see this component in the windows form projects.
Hi VBDT,
Never did I, but after a quick search found that it's for Windows Mobile.
Wkr,
sparrow1
-
Nov 30th, 2006, 06:58 PM
#11
Re: selectPictureDialog problem
What are you expecting to happen? You get the path of the file the user selected and assign it to a string. That's all. At no point do you open that file and create an Image object. Also, what if the user presses the Cancel button? Make sure you test the return value of ShowDialog, as previously suggested.
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
|