RadTextBox: ClearButton beside TextBoxElement does not react to mouse events

1 Answer 55 Views
TextBox
tar
Top achievements
Rank 2
Iron
Iron
Iron
tar asked on 15 Sep 2023, 11:13 AM | edited on 15 Sep 2023, 11:22 AM

Hello,

I am trying to get the ClearButton of the RadTextBox next to the TextBoxElement to work but when I place it next to it (via Margin and a bit of Padding) the ClearButton does not react to any mouse events anymore. All the mouse releated hover properties of the ClearButton are false, as well (ContainsMouse, IsHovered, IsMouseOver).

Most interesting here is that the tbxWithMargin.TextBoxElement.MouseMove event is triggered but it does not recognize that the mouse is over the ClearButton. I've also tried to check here if the cursor is over its BoundingRectangle without success.

You can see this behaviour in the attached project.

If this would be possible (without a general mouse move check event of the whole form!), I'd also would like to use this ClearButton placement for a RadTextBoxControl.

1 Answer, 1 is accepted

Sort by
1
Nadya | Tech Support Engineer
Telerik team
answered on 19 Sep 2023, 12:26 PM

Hello, M. S.,

The provided project is greatly appreciated.

Indeed, the clear button is intended to be shown inside the text box element and this is by design. You are not able to use the mouse events because you actually move the clear button out of the text box element. In your case, I can suggest creating a custom user control that hosts a RadTextBoxControl and RadButton. Then, you can arrange the button and customize it according to your needs and use this custom control in your application. I prepared a sample project for your reference.

Do not hesitate to contact us if you have other questions.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
TextBox
Asked by
tar
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or