Solved

Validating event and sticky forms

Posted on 2006-07-12
1
207 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now