Solved

Validating event and sticky forms

Posted on 2006-07-12
1
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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 …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

751 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