Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
740
Double Click event doesnt work for UltraTextEditor
posted

Hi everyone,

I have a simple UltraTextEditor, which its Multiline = true, which is used to display some note description. When the form loads its set as ReadOnly = true; I want the textbox to be editable when I double click it. I used the DoubleClick event and also tried MouseDoubleClick events to set the ReadOnly = false. But no use!! Am I missing anything?

Please need urgent help!

Thanks in advance...

NW 

 

Parents
  • 37774
    Verified Answer
    posted

     The UltraTextEditor is positioning a .NET TextBox within its bounds, even when it is set to ReadOnly mode.  What you could do is hook the DoubleClick event of the TextBox in the ControlAdded event of the editor, i.e.:

    private void ultraTextEditor1_ControlAdded(object sender, ControlEventArgs e)
    {
        e.Control.DoubleClick += new EventHandler(Control_DoubleClick);
    }

    private void ultraTextEditor1_ControlRemoved(object sender, ControlEventArgs e)
    {
        e.Control.DoubleClick -= new EventHandler(Control_DoubleClick);
    }

    void Control_DoubleClick(object sender, EventArgs e)
    {
        this.ultraTextEditor1.ReadOnly = false;
    }

    -Matt

Reply Children