Hello, I have some question.
I create a User Control with one RichTextBox and one ultraToolbarsManager.
I use ultraToolbarsManager to create floating toolbar. (always float, no dock with any)
1. How can I make this toolbar always on top?
2. I also want, when richtextbox have focused this toolbar will show, and when richtextbox lost focus this tollbar will hide.
Please help me!!
Thank you.
Another question:
How can I set position for this tollbar if I want it display in top-right of richtextbox?
I got it,
Add this code after InitializeComponent
if (this.richTextBox1.Focused == true) { this.ultraToolbarsManager1.Toolbars[0].Settings.AllowHiding = DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].DockedPosition = DockedPosition.Floating; this.ultraToolbarsManager1.Toolbars[0].Visible = true; } else { this.ultraToolbarsManager1.Toolbars[0].Settings.AllowHiding = DefaultableBoolean.True; this.ultraToolbarsManager1.Toolbars[0].Visible = false; }
And use Event: Enter and Leave
private void richTextBox1_Leave(object sender, EventArgs e) { this.ultraToolbarsManager1.Toolbars[0].Settings.AllowHiding = DefaultableBoolean.True; this.ultraToolbarsManager1.Toolbars[0].Visible = false; } private void richTextBox1_Enter(object sender, EventArgs e) { this.ultraToolbarsManager1.Toolbars[0].Settings.AllowHiding = DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].DockedPosition = DockedPosition.Floating; this.ultraToolbarsManager1.Toolbars[0].Visible = true; }
I tried use this, but it dose not work
private void exRichTextBox_MouseEnter(object sender, EventArgs e) { ultraToolbarsManager1.HideToolbars = false; } private void exRichTextBox_MouseLeave(object sender, EventArgs e) { ultraToolbarsManager1.HideToolbars = true; }