Hi Erel,
sure, here is my sample:
The following function will called to show form (it is a key pad with 3x4 ImageButtons)
Sub ShowNumForm
For i = 0 To 3 Step 1
For j = 1 To 3 Step 1
AddEvent("ib"&j+i*3,ButtonDown,"frmNum_ButtonDown")
AddEvent("ib"&j+i*3,ButtonUp,"frmNum_ButtonUp")
AddEvent("ib"&j+i*3,Click,"frmNum_Click")[/indent]Next j
Next i
frmNum.Show
End Sub
Sub frmNum_ButtonDown
Sender.Image = il1.Item(3)
End Sub
Sub frmNum_ButtonUp
Sender.Image = il1.Item(2)
End Sub
Sub frmNum_Click
ValPanel.Text = ValPanel.Text & Sender.Text
End Sub
The il1 is a ImageList filled up with (serveral) Images for the buttons.
The ImageButtons are not created by AddImageButton Function, they are set with the designer.
The frmNum_Click Function will trigger if I press a button. But not the Button Up nor Down.
If I use the Designer to create the Events for one of those Buttons (Event for Up and Down) then it works.
But there I have my second problem. The Image will not changed or it get the wrong one. Actually I found that this will happens only if I use transparent. If it is not transparent, then the correct image will show on ButtonDown and Up.
If you could not exactly understand what I mean, I'm sorry for my english, lol.
Thanks for your help.