| | |
How do I limit text char in Combo box?
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2004
Posts: 16
Reputation:
Solved Threads: 0
I have a combo box I want to limit user input
I have the following code on 'keypress' event
dim keyascii as short = asc(e.keychar)
dim s as string
if keyascii = 45 then
exit sub
end if
' allow '-' key
s=checkalphanumeric(s,"AN")
' My function to check keyascii
's returns 0-9, a-z, A-Z if true
if s="" then
exit sub
end if
e.handled=true
end sub
I have same code used for text boxes except 'e' is 'eventargs' & it works
I can still type anything in my combo box, am I missing something?
any help much appreciated
I have the following code on 'keypress' event
dim keyascii as short = asc(e.keychar)
dim s as string
if keyascii = 45 then
exit sub
end if
' allow '-' key
s=checkalphanumeric(s,"AN")
' My function to check keyascii
's returns 0-9, a-z, A-Z if true
if s="" then
exit sub
end if
e.handled=true
end sub
I have same code used for text boxes except 'e' is 'eventargs' & it works
I can still type anything in my combo box, am I missing something?
any help much appreciated
![]() |
Similar Threads
- Combo Box not populating (VB.NET)
- Colouring the Combo box (Visual Basic 4 / 5 / 6)
- Combo Box and ASP.net (ASP.NET)
- Text files in combo box (PHP)
- Using the combo box to set the Default Member and Value Member names (VB.NET)
- add to combo box from access with where statment (Visual Basic 4 / 5 / 6)
- combo box with related records (MS Access and FileMaker Pro)
Other Threads in the VB.NET Forum
- Previous Thread: Connectivity problem with Sybase Adaptive Server 7.0
- Next Thread: Displaying pictures on Windows Forms using subprocedures in VB.NET
Views: 6910 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access add application array assignment basic binary box button buttons center click code connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net employees error excel exists firewall folder image images isnumericfuntioncall listview login math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan peertopeervideostreaming picturebox plugin port print printing printpreview problem record refresh regex reports" reuse save savedialog serial sorting sql sqldatbase storedprocedure string structures studio temp textbox timer upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml





