'Declaration Public Enum FormattedTextMenuItems Inherits System.Enum
public enum FormattedTextMenuItems : System.Enum
Member | Description |
---|---|
All | Display all menu items. Note that if you specify All, any new menu items that get implemented in the future will also be displayed when you upgrade your application to the newer version. |
Bold | Menu item for toggling the bold attribute of selected text. |
Copy | Copy menu item. |
Cut | Cut menu item. |
Default | Default is to display Cut, Copy, Paste, Undo, Redo and SelectAll menu items. |
Delete | Delete menu item. |
Font | Display menu item(s) that allow the user to change font of the selected text. |
Image | Display menu item(s) that allow the user to insert image and change the attributes of existing image. |
Italics | Menu item for toggling the italics attribute of selected text. |
LineAlignment | Display menu items that allow the user change the line alignment. |
Link | Display menu item(s) that allow the user to insert links and modify the existing links. |
None | Don't display any context menu. |
Paragraph | Display menu items that allow the user to change paragraph settings. |
Paste | Paste menu item. |
Redo | Redo menu item. |
Reserved | Reserved. For internal use only. |
SelectAll | Select All menu item. |
SpellingSuggestions | This will display list of suggested words in the context meny when it's displayed over a misspelled word. Note that in order for this option to have any effect, a spell-checker must be assigned to the editor control or the column. |
Strikeout | Menu item for toggling the strikeout attribute of selected text. |
Subscript | Menu item for toggling the subscript attribute of selected text. |
Superscript | Menu item for toggling the superscript attribute of selected text. |
Underline | Menu item for toggling the underline attribute of selected text. |
Undo | Undo menu item. |
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.Misc Imports Infragistics.Win.FormattedLinkLabel Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click ' By default the right-click context menu displays a subset of options supported ' by the formatted text editor. You can control which options get displayed in ' the context menu using the ContextMenuItems property. Me.ultraFormattedTextEditor1.ContextMenuItems = FormattedTextMenuItems.All ' You may want to prevent the control from hiding selection whenever it looses ' focus. Set HideSelection to false for that. Me.ultraFormattedTextEditor1.HideSelection = False ' PerformAction can be used to perform keyboard actions. This would be useful ' for example if you had toolbar buttons for performing certain operations that ' are also supported by the built-in key actions. Me.ultraFormattedTextEditor1.PerformAction(FormattedLinkEditorAction.ToggleBold, False, False) ' EditInfo property returns an object that can be used to perform various edit ' related operations. Dim editInfo As FormattedTextEditInfo = Me.ultraFormattedTextEditor1.EditInfo ' Set the editor's value to some formatted text for testing purposes. Me.ultraFormattedTextEditor1.Value = "Test <b>Value</b>." ' Select some contents. editInfo.SelectionStart = 5 editInfo.SelectionLength = 5 ' Make the selected contents into a link. editInfo.MakeSelectionIntoLink("<a href=""http:://www.infragistics.com""></a>") ' Apply some style on the selected content. Please consult help for a listing of ' supported style attributes. editInfo.ApplyStyle("font-size: +8pt; font-family: Courier New; background-color: Yellow", False) ' Use the Value property to get the new formatted text from the editor. Since ' Value property is object type, simply call ToString to convert it to a string. Dim newFormattedText As String = Me.ultraFormattedTextEditor1.Value.ToString() ' Print out the new value. Debug.WriteLine("New formatted text = " & newFormattedText) End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.Misc; using Infragistics.Win.FormattedLinkLabel; using System.Diagnostics; private void button1_Click(object sender, System.EventArgs e) { // By default the right-click context menu displays a subset of options supported // by the formatted text editor. You can control which options get displayed in // the context menu using the ContextMenuItems property. this.ultraFormattedTextEditor1.ContextMenuItems = FormattedTextMenuItems.All; // You may want to prevent the control from hiding selection whenever it looses // focus. Set HideSelection to false for that. this.ultraFormattedTextEditor1.HideSelection = false; // PerformAction can be used to perform keyboard actions. This would be useful // for example if you had toolbar buttons for performing certain operations that // are also supported by the built-in key actions. this.ultraFormattedTextEditor1.PerformAction( FormattedLinkEditorAction.ToggleBold, false, false ); // EditInfo property returns an object that can be used to perform various edit // related operations. FormattedTextEditInfo editInfo = this.ultraFormattedTextEditor1.EditInfo; // Set the editor's value to some formatted text for testing purposes. this.ultraFormattedTextEditor1.Value = "Test <b>Value</b>."; // Select some contents. editInfo.SelectionStart = 5; editInfo.SelectionLength = 5; // Make the selected contents into a link. editInfo.MakeSelectionIntoLink( @"<a href=""http://www.infragistics.com""></a>" ); // Apply some style on the selected content. Please consult help for a listing of // supported style attributes. editInfo.ApplyStyle( "font-size: +8pt; font-family: Courier New; background-color: Yellow", false ); // Use the Value property to get the new formatted text from the editor. Since // Value property is object type, simply call ToString to convert it to a string. string newFormattedText = this.ultraFormattedTextEditor1.Value.ToString( ); // Print out the new value. Debug.WriteLine( "New formatted text = " + newFormattedText ); }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2