|
-
Aug 25th, 2003, 06:09 PM
#1
Thread Starter
Junior Member
Fill Combobox
Hi,
When I load the form, I want to load all zipcode table into the cbx but I want to leave the zip code of the first client selected. And when I change client I want to change the cbx text value.
any idea?
thanks
-
Aug 26th, 2003, 12:16 AM
#2
-= B u g S l a y e r =-
you could use the sendessage api to find and select an item in the combo.
VB Code:
Option Explicit
'set style of combo to 2-dropdown list
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Private Const CB_FINDSTRING = &H14C
Private Sub Form_Load()
Combo1.Clear
Combo1.AddItem "peet"
Combo1.AddItem "muzzi"
Combo1.AddItem "hack"
Combo1.AddItem "beachbum"
Combo1.AddItem "darre1"
Combo1.AddItem "plenderj"
Text1.Text = "muzzi"
End Sub
Private Sub Text1_Change()
Combo1.ListIndex = SendMessage(Combo1.hwnd, CB_FINDSTRING, -1, ByVal CStr(Text1.Text))
End Sub
that what you are after ?
-
Aug 26th, 2003, 01:12 PM
#3
Thread Starter
Junior Member
-
Aug 27th, 2003, 12:32 AM
#4
-= B u g S l a y e r =-
your welcome pintojoa
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
|