Board index » cppbuilder » TImage::OnMouseUp Event
Robert G. Hoover
2006-06-07 01:31:27 AM
In BCB6, I used TImages to draw my own buttons and used OnMouseDown and
OnMouseUp to draw the down and up states for my buttons.
When the user pushed my button, it did not matter where (X,Y) he
released the mouse button. My OnMouseUp routine fired and I had to check
the bounds of my object.
// check bounds
if ((X>= 0) && (X < MyButton->Width)
&& (Y>= 0) && (Y < MyButton->Height))
// do something...
Is this still necessary in BCB2006? My problem is that if something has
been altered in BCB so that I do not have to check for the bounds
anymore, then I need to snatch the mouse event to make sure my OnMouseUp
event fires. The current behavior is that if I press the mouse button
down over MyButton1 and drag over to MyButton2 and release the mouse
button over MyButton2, then the MyButton1::OnMouseDown fires followed by
the MyButton2::OnMouseUp. It's killing me! ;)
Can anyone help? Can I somehow override so that the user's mouse button
release always fires the OnMouseUp event for the object that fired the