Solved

Validating event and sticky forms

Posted on 2006-07-12
1
210 Views
Last Modified: 2011-09-20
Hi,

After the validating of a textbox fires (cancel = true), if users want to quit the form by click the close, it would not go away because of the validating event also cancels the close operation.

I have heard of a workaround, but I need your help on how to implement it.

I want to check the mouse click area within the validating event, if it is in the form’s client area, then normal cancel will happen, otherwise, do not set cancel to true.


0
Comment
Question by:ommer
1 Comment
 
LVL 14

Accepted Solution

by:
ptakja earned 125 total points
ID: 17095265
This code is for VS 2005...

In the Validating event of the textbox you can get at the mouse coordinates like:

Me.MousePosition.X
Me.MousePosition.Y

So you could use these values to compare against the form's boundaries, etc...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Modal Popup Extender control 1 49
Convert datetime to time string 10 34
location of a form 2 32
Groupbox Control ? 2 27
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question