I need a richtextbox which can perform all the basic activities like Bold, Italic, Indent, Numbering, Bullets, say for example the control which I am typing it in right now. Is this control available in Winforms?
I am trying to use UltraFormattedtextEditor but we have to add all the tools to UltraToolbarManager and on click event of the button we need to handle something like this :
private void ultraToolbarsManager1_ToolClick(object sender, ToolClickEventArgs e){ switch(e.Tool.Key) { case "StateButtonTool1": // Bold Tool this.ultraFormattedTextEditor1.EditInfo.PerformAction( FormattedLinkEditorAction.ToggleBold); break; case "StateButtonTool2": // Italic Tool this.ultraFormattedTextEditor1.EditInfo.PerformAction( FormattedLinkEditorAction.ToggleItalics); break; case "StateButtonTool3": // Underline Tool this.ultraFormattedTextEditor1.EditInfo.PerformAction( FormattedLinkEditorAction.ToggleUnderline); break; }}How do we handle for Indent, Numbering, Bullets? Is there any other control which performs all these actions without writing the code for each button?
private void
object
switch
case
// Bold Tool
this
break
// Italic Tool
// Underline Tool
UltraFormattedtextEditor does not support everythign that the RichTextBox supports, which is why you can't get numbering or bullets (can't remember if it supports indentation). I believe the UITypeEditor it uses was made available for public consumption, so you would be able to present one to users and they could use that, so you wouldn't have to write the ToolClick code yourself.
Brian Fallon"] UltraFormattedtextEditor does not support everythign that the RichTextBox supports, which is why you can't get numbering or bullets (can't remember if it supports indentation). I believe the UITypeEditor it uses was made available for public consumption, so you would be able to present one to users and they could use that, so you wouldn't have to write the ToolClick code yourself.
Brian,
Thanks for your response. I couldn't quite understand your answer. Sorry about that. So are you saying that there is no control from Infragistics which can support all these features in windows forms
I need a textbox with all basic features
Bold, Italics, Underline, Indentation, Bullets, Numbering, Cut, Copy, Paste.
Also, it needs to save the text into the database with the formatted text. For example, If I have made some text bold, and save the text, while I retrieve it should again have that text in Bold.
Please advise. By the way what is the control which is being used to write a post? It actually has all the features I wanted.
Thanks
Hi,
As Brian said, the UltraFormattedTextEditor does not support bullets or numbering. But it supports everything else you listed here - assuming that by Indentation you mean tabs.
To save the contents with the formatting to a DataBase, you would just store the control's Value property, which will return an XML string.
The mention of the UITypeEditor is a reference to the Infragistics2.Win.SupportDialogs assembly. This assembly contains the same editor you can see at Design-time when you edit the Value property on the UltraFormattedTextEditor.
So if you add a reference to this assembly to your application, you can do something like this:
private void button1_Click(object sender, EventArgs e) { FormattedTextUIEditorForm formattedTextUIEditorForm = new FormattedTextUIEditorForm(this.ultraFormattedTextEditor1); formattedTextUIEditorForm.Value = this.ultraFormattedTextEditor1.Value; DialogResult result = formattedTextUIEditorForm.ShowDialog(this); if (result == DialogResult.OK) { this.ultraFormattedTextEditor1.Value = formattedTextUIEditorForm.Value; } }
By the way... I'm pretty sure that there is a RichTextBox control in DotNet. I think it might not be added to the Toolbox by default, so you might just have to add it in.
Hi Mike,
isn't there any implementation of this feature that you or your fellow developers could provide?
It would be just great to have an UltraFormattedTextEditor with a little toolbar on top, where the user can format the text. Just like in this webform I'm just typing my text in.
In my case I would need this extended UltraFormattedTextEditor be embeded into gird cells.
Any help from your side would be greatly apreciated :)
One additional question: Is there a method to strip any formating and return the plain text?
Regards,
Martin
Hi Martin,
MISUMI said: isn't there any implementation of this feature that you or your fellow developers could provide? It would be just great to have an UltraFormattedTextEditor with a little toolbar on top, where the user can format the text. Just like in this webform I'm just typing my text in. In my case I would need this extended UltraFormattedTextEditor be embeded into gird cells. Any help from your side would be greatly apreciated :)
There's nothing like that built-in. The best suggestion I have is that you could create a UserControl with an UltraFormattedTextEditor and a toolbar and code it yourself. Then you could use that UserControl in the grid using the new UltraControlContainer editor.
MISUMI said:One additional question: Is there a method to strip any formating and return the plain text?
For a standalone control, you can just use the Text property of the control.
For a grid cell, use the Text property of the cell.