|
-
December 9th, 1999, 03:21 AM
#1
Comboboxes
Hi again,
Is there anyway for me to set the maximum length of characters which the user may enter(I am using Combobox with Style 0), so that I can prevent an overflow during data entry?
____________________________________
The VB Bugs in my Life...
-
December 9th, 1999, 03:45 AM
#2
Re: Comboboxes
Take a form with a combo (combo1) and paste in the following:
option Explicit
private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, byval lParam as Long) as Long
private Const CB_LIMITTEXT = &H141
private Sub Form_Load()
Dim lRet as Long
'
Dim lTextLimit as Long
'
lTextLimit = 4 ' only four characters allowed in combo
'
lRet = SendMessageLong(Combo1.hwnd, CB_LIMITTEXT, lTextLimit, 0)
End Sub
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
December 9th, 1999, 03:56 AM
#3
Re: Comboboxes
Thanks!!
It works!
____________________________________
The VB Bugs in my Life...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|