\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Combo box input validation


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
As with most of the people who decide to join this forum, I\'m rather new to VB. So far, most of my problems have been answered by a simple search, but this time around I wasn\'t so lucky, even after several attempts.
\r\n
\r\nI\'m using Visual Basic for Visual Studio 2005 at the moment, and basically what I\'m trying to do is prevent my users from manually typing in a choice in a combo box that isn\'t in the selection I\'ve given them. It\'s an unbound source, so it should be simple enough... I\'m just having a hard time finding the right events/methods to use to do this in a neater manner than having to brute force it over the whole list. It feels too messy.
\r\n
\r\nEdit: So far I\'ve tried using the ComboBox.Validated() event, but somehow this seems counterproductive to me - I want the event to trigger when the contents are not valid, not when they\'re valid.
\r\n
\r\nApologies in advance if I put this in the wrong forum or if I didn\'t give the right info somehow... hopefully my first shot at asking for help wasn\'t a bad one.
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n
\r\n __________________
\r\n http://quotedfortruth.net\r\n
\r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n Last edited by FragMagnet; 08-07-2007 at 01:36 AM.\r\n \r\n \r\n Reason: update in info\r\n \r\n \r\n
\r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[1244069] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 08-07-2007, 06:50 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
LaVolpe\'s Avatar\r\n\r\n
\r\n \r\n LaVolpe\r\n LaVolpe is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 08-07-2007, 01:31 AM
FragMagnet FragMagnet is offline
Newcomer
 
Join Date: Aug 2007
Posts: 9
Default Combo box input validation


As with most of the people who decide to join this forum, I'm rather new to VB. So far, most of my problems have been answered by a simple search, but this time around I wasn't so lucky, even after several attempts.

I'm using Visual Basic for Visual Studio 2005 at the moment, and basically what I'm trying to do is prevent my users from manually typing in a choice in a combo box that isn't in the selection I've given them. It's an unbound source, so it should be simple enough... I'm just having a hard time finding the right events/methods to use to do this in a neater manner than having to brute force it over the whole list. It feels too messy.

Edit: So far I've tried using the ComboBox.Validated() event, but somehow this seems counterproductive to me - I want the event to trigger when the contents are not valid, not when they're valid.

Apologies in advance if I put this in the wrong forum or if I didn't give the right info somehow... hopefully my first shot at asking for help wasn't a bad one.
__________________
http://quotedfortruth.net

Last edited by FragMagnet; 08-07-2007 at 01:36 AM. Reason: update in info
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->