CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: CommonDialog

  1. #1
    Join Date
    Jun 2000
    Location
    France
    Posts
    72

    CommonDialog

    Hi
    Anyone can tell me how i can know when a cancel button has been clicked when i open a CommonDialog ?
    Thanks


  2. #2
    Join Date
    Feb 2000
    Posts
    440

    Re: CommonDialog

    There is a property of commondialog:

    cancelerror

    when it is set to true you get error when user press cancel.

    use onerror goto to trap this situation



    Valery Iskarov Nikolov
    http://listen.to/quark

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: CommonDialog

    Just to add to vin comment

    Use the CancelError property to trigger a trappable error if cancel is selected, i.e.


    private Sub Command1_Click()
    on error GoTo Cancelled
    With CommonDialog1
    .CancelError = true
    .ShowSave
    'Save Code Here
    End With
    MsgBox "File Saved.", vbInformation + vbOKOnly, "Saved."
    Cancelled:
    End Sub



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured