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
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
FAQ:Mouse events such as MouseDown, MouseUp, and DoubleClick do not fire for an UltraWinEditor it is in edit mode.
Very helpful with the UltraTextEditor!
but how about, if the DoubleClick is to happen in an UltraWinGrid Cell?
same problem, but I can't figure out how to do it here...
Thank you!
Liz
In this case, you need to handle the events of the grid, since the UltraTextEditor is not being used as a control anymore, but rather is providing the editor that the grid positions in its cell. This KB article should help you determine which cell was clicked in the grid. If you're referring to the same problem in the previous posts, then you would do the same workaround that was given, except that you'd be hooking the ControlAdded/Removed of the grid instead of the UltraTextEditor.