This is a migrated thread and some comments may be shown as answers.

RadTextBoxControl triple click

2 Answers 92 Views
TextBoxControl
This is a migrated thread and some comments may be shown as answers.
Tino
Top achievements
Rank 1
Tino asked on 12 Feb 2018, 01:21 AM

I'm trying to intercept a triple-click in a textbox control. I've tried this test code with breakpoints but only a single click is trapped. My goal is to override the double-click and triple-click behaviour to highlight text in custom ways. I had double-click working by handling the DoubleClick event and doing my stuff in there, and then also handling SelectionChanging to override the default behaviour there (or my custom highlighting would be still overridden by the default double-click handling, which is to select the entire current line).

private void TxtboxOnMouseClick(object sender, MouseEventArgs mouseEventArgs)
{
    var clicks = mouseEventArgs.Clicks;
    switch (clicks)
    {
        case 1:
            break;
        case 2:
            break;
        case 3:
            break;
    }
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 12 Feb 2018, 03:08 PM
Hi Tino,

Thank you for writing.

There is no built-in way to capture the triple click event. However, you can easily achieve it with the help of a timer and if count the performed clicks. This approach is discussed in the following MSDN resource: https://social.msdn.microsoft.com/Forums/vstudio/en-US/c31536a3-2939-4835-a5ae-0c7a23eba36b/how-can-i-process-a-tripleclick-event-on-a-textbox?forum=winforms.

I hope this helps. Let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tino
Top achievements
Rank 1
answered on 12 Feb 2018, 09:15 PM
ok thanks
Tags
TextBoxControl
Asked by
Tino
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Tino
Top achievements
Rank 1
Share this question
or