Results 1 to 11 of 11

Thread: selectPictureDialog problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Question selectPictureDialog problem

    Hi guys
    I am trying to use the selectPictureDialog.
    Here's the code i already have:
    VB Code:
    1. Dim selectPictureDialog As SelectPictureDialog = New SelectPictureDialog
    2.         Dim selectedFile As String
    3.         With selectPictureDialog
    4.             .InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
    5.             .Filter = "JPEG (*.jpg)|*.jpg"
    6.             .FilterIndex = 1
    7.             .CameraAccess = True
    8.             .ShowDialog()
    9.             selectedFile = .FileName
    10.             '.SortOrder = SortOrder.DateAscending
    11.         End With
    12.         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

  2. #2
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: selectPictureDialog problem

    Outside the 'With'
    VB Code:
    1. If selectPictureDialog.ShowDialog = DialogResult.OK Then
    2.                 selectedFile = .FileName
    3.                 End if
    4. MsgBox("Photos shown")
    Inside should work as well but you need that conditional statement.
    VB 2005, Win Xp Pro sp2

  3. #3
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: selectPictureDialog problem

    Umpf, name your dialog something else than the class, like selectPictureDialog1
    VB 2005, Win Xp Pro sp2

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    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

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    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

  6. #6
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  7. #7
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: selectPictureDialog problem

    What type of control is "SelectPictureDialog"? I have never seen this component. Is this a custom control? a third party component?

  8. #8
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: selectPictureDialog problem

    Quote 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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  9. #9
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: selectPictureDialog problem

    thanks sparrow1 that might be it. I have never see this component in the windows form projects.

  10. #10
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: selectPictureDialog problem

    Quote 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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  11. #11
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width