|
-
Aug 4th, 2000, 05:14 PM
#1
Thread Starter
Junior Member
Been sitting on this problem for 5 hours... please help.
I've got an app with an imagecombo. I want it to work so that when I click a certain picturebox, the imagebox drops down. I've done this using the following API code:
This in a module on one line)
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
And the following on the form:
Private Sub Picture1_Click()
Const CB_SHOWDROPDOWN = &H14F
Dim Tmp
Tmp = SendMessage(ImageCombo1.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0&)
End Sub
Private Sub ImageCombo1_Click()
page = CInt(ImageCombo1.Text) - 1
nextpageclick_Click 'This is the procedure it's supposed to run when the user clicks on oneof the list options
bookmark_current_position 'this is just another one of my functions
End Sub
Ok, now my problem is that the FIRST time each time I run that I click on the picturebox, the list drops down but then when I select something on the list it just makes that the new selected item , without running ImageCombo1_Click, even though I just clicked on it.
After the first click, it works fine. But I need to click on the drop down list once without anything happenning to get it to work.
I used break points to discover that the click event was not being called the first time at all, though I don't know why.
When I try just dropping the list without using the picturebox to "remotely" drop it, then the first time I click, it drops then disappears and only the after the second click it stays down and works when clicked on.
This is the sub I use to populate the imagelist
Sub init_jumper() 'INITIALIZES THE "JUMPER" COMBO LIST
Set ImageCombo1.ImageList = ImageList1
Dim n01 As ComboItem
Set n01 = ImageCombo1.ComboItems.Add(1, "COVER", "0", 1)
Dim n02 As ComboItem
Set n02 = ImageCombo1.ComboItems.Add(2, "PAGE01", "1", 2)
Dim n03 As ComboItem
Set n03 = ImageCombo1.ComboItems.Add(3, "PAGE02", "2",
ImageCombo1.SelectedItem = ImageCombo1.GetFirstVisible
End Sub
Even without that last line it still doesn't work.
Please help.
please.
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
|