Detecting the Cancel Button

Detecting the Cancel Button

Question:
In my “Save As” dialog box (from CMDIALOG.VBX), my OK button and Cancel button both save work. How do I recognize when the userpresses the Cancel button?

Answer:
One of the properties of the Common Dialog (before you set the Action property) you can set is the CancelError flag. If you set this, you will get a trappable error indicating that the user pressed the Cancel button. Unfortunately, it is the only way to catch the button. There is an example in the VB help file for this topic, and it is fairly straightforward (once you know it exists, that is).

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several