![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I've a problem with the "ButtonDown" and "ButtonUp" Event
I set it with AddEvent("ib"&j+i*3,ButtonDown,"frmNum_ButtonDown") in a loop to serveral ImageButtons in RunTime. But they did not trigger. In my routines I will change the look of those ImageButtons while they are pressed with a different Image from a ImageList. If I set they with single events with the Designer it will work. If I use Click instead of ButtonDown or ButtonUp it will work too. If the sub will be called, it will change the image, but it shows me a red rectangle with a cross in it. Thanks for any help If I send the image from the ImageList to the form, it will appear correctly. I have no idea what's going on. Maybe someone had the same trouble before and shares the solution or have another idea. |
|
|||
|
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. |
|
|||
|
Hi Gary
Yes, that is what I mean too. If you take a look in the help file, you will see, that the ImageButton has the Events ButtonDown ButtonUp Click listed. But if you look at AddEvent(), the ImageButton is not listet as a Control which support events. My opinion was: There is the button listed and ImageButton is a member of buttons or buttons are the parent of it and ImageButton will inherit the same events. After a look at the designer by Events for a ImageButton, I found it there too. So for me it was clear. ImageButon has those three events. Now I think it is forgotten to implement or the connections from the Button Class do not trigger correctly. How ever, it is a work for Erel I think. You and me can't found a wrong code on this smal example and it is a quite easy one. At time I use the FormEvent MouseDown(x,y) and MouseUp(x,y) for analysing the position and for to get my information which button is down or up. Thanks for your help Haschi |
|
||||
|
Quote:
An example is given already ![]() I think that I am also right in saying that catching the mouseup/down event on the form won't work when run on the device because the imagebutton blocks the event from happening, unlike on the desktop. Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
|||
|
Thank you RandomCoder,
I didn't known this. I didn't have test my application on ppc. At time I'm on beginning to develope a new project and I think it will need a longer time to finish. If Erel has released a new version with those events, I will use that one. But I will take a look on DZT's Magic Events. Maybe this one is helpfull for other points too. Have a nice weekend Haschi |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ImageList items as Reference? | DaveW | Questions & Help Needed | 3 | 11-07-2008 08:35 AM |
| Problem using AddEvent | EdQas | Questions & Help Needed | 7 | 09-09-2007 10:51 AM |
| How to save images after they have been placed in an imagelist | XerVision | Questions & Help Needed | 2 | 07-13-2007 09:59 PM |
| Can we compare imagelist items? | Cableguy | Questions & Help Needed | 1 | 06-02-2007 06:03 PM |
| I need examples for imagelist imagebutton | sloopa | Questions & Help Needed | 2 | 05-19-2007 05:00 PM |