简体   繁体   中英

Flatten a TSpeedButton?

Is there anyway to force a TSpeedButton to be redrawn flat?

When using a touch screen monitor, the mouse does not move out of the button, so the raised border stays on screen, even when you click on a different button.

It doesn't look like this is something I can reproduce without a touch screen, but if I understand you correctly, when someone touches a button then it goes hot (either rising up if Down is true, or highlighting), but when they touch another button it doesn't trigger the mouse exit so it stays hot. Is that correct?

There are a couple ways to fix this. Probably the simplest is on each click event make a call top a method that moves the mouse off off the button.

Mouse.CursorPos := Point(0,0);

If that is not enough then you can disable the button that was clicked on, move the mouse off, refresh it, and re-enable it. A disabled button cannot be hot. You might want a timer that enables the button after it was disabled for a second with the mouse moved off of it, but I am betting that just moving the mouse will be enough.

Additionally I always thought it was cheese when a mouse cursor was left on the button that I just touched, so this will make your touch system look classier.

您是否尝试将Flat属性设置为True?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM