Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / September 2006

Tip: Looking for answers? Try searching our database.

Validating input on a control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mfr - 13 Sep 2006 16:06 GMT
I have two text boxes on a windows form and each has an associated
ErrorProvider.

The maximum value of textBox2 must not exceed the value entered into textBox1.

I am capturing the 'Leave' event from textBox1 to update the maximum value
of textBox2. This works correctly, as the tooltip on textBox2 updates
correctly.

But, how can I get textBox2 to re-validate so that the error icon appears if
the value in textBox2 is greater than its new maximum value. Currently it
only validates when textBox2 looses focus.

Regards,
Dave.
Linda Liu [MSFT] - 14 Sep 2006 03:43 GMT
Hi Dave,

You could re-validate if the value in textBox2 is greater than its new
maximum value right after you update the maximum value of textBox2.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
mfr - 14 Sep 2006 08:04 GMT
My question was how do I force a control to revalidate? I couldn't see any
methods that force a revalidation.

Regards,
Dave.

> Hi Dave,
>
[quoted text clipped - 26 lines]
>  
> This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu [MSFT] - 14 Sep 2006 10:29 GMT
Hi Dave,

Thank you for your prompt response.

> My question was how do I force a control to revalidate?
Do you mean that you want the Validating event of the textBox2 to be
raised? Only when the CausesValidation property of the textBox2 is true and
the focus is moving from the textBox2 to another control whose
CausesValidation property is also true, the Validating event of the
textBox2 will be raised.

Actually, I think you could directly call the CausesValidating event
handler of the textBox2 to force it to revalidate.

Hope this helps.
If I misunderstand you or you have any concerns, please feel free to let me
know.

Sincerely,
Linda Liu
Microsoft Online Community Support
mfr - 14 Sep 2006 10:42 GMT
Linda,

That works,

Thank you.

Dave.

> Hi Dave,
>
[quoted text clipped - 17 lines]
> Linda Liu
> Microsoft Online Community Support

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.