Results 1 to 4 of 4

Thread: [SOLVED] Question about Common Dialog

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    46

    Resolved [SOLVED] Question about Common Dialog

    Hey Guys
    I have question about common dialog ,
    I use one as open file dialog to open pictures ,
    the thing is the pictures sometimes be big in size and take time to be drawn to the picturebox (may be in some cases 3-5 seconds) , so , is there any chance that I can make the dialog box disappear while it open the picture selected , not waiting for opening the pic then disappear????
    Last edited by karim_fone; Apr 22nd, 2009 at 04:27 AM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Question about Common Dialog

    It's always a good idea to show your actual code but since you did not try the following:
    Code:
    Private Sub Command1_Click()
    Dim strFileName As String
    
    On Error GoTo ErrHandler
    
        With CommonDialog1
            .Filter = "Pictures (*.bmp;*.jpg;*.gif)|*.bmp;*.jpg;*.gif"
            .Flags = cdlOFNExplorer
            .CancelError = True
            .ShowOpen
            strFileName = .FileName 'assign file name to a variable
        End With
        
        DoEvents 'pass control to os
        Picture1.Picture = LoadPicture(strFileName) 'finally load your image file
        
        Exit Sub
        
    ErrHandler:
        Err.Clear
    
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    46

    Re: Question about Common Dialog

    thanks RhinoBull for helping , my code was the same as yours but without DoEvents
    cheers

  4. #4
    New Member
    Join Date
    Mar 2009
    Posts
    13

    Re: [SOLVED] Question about Common Dialog

    How I can show common dialog ( commondialog1.showfont for Example) in center of screen ?

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