Spread Windows Forms 9.0 Product Documentation
SelectedText Property (SuperEditBase)
Example 


Gets or sets the currently selected text in the edit control.
Syntax
'Declaration
 
Public Overridable Property SelectedText As String
'Usage
 
Dim instance As SuperEditBase
Dim value As String
 
instance.SelectedText = value
 
value = instance.SelectedText
public virtual string SelectedText {get; set;}

Property Value

String containing the selected text
Remarks

When no selection has been made in the control, the SelectedText property returns an empty string. However, if the AllowNull property is set to true, the SelectedText property returns the null value.

You can assign a string to the SelectedText property to replace the selected text.

To return the number of characters in the selection, return the value of the SelectionLength property.

This property is available at run time only.

Example
control.EditModeCursorPosition = FarPoint.Win.EditModeCursorPosition.LastKnownPosition;
control.Text = "This is a test for HideSelection";
control.ControlType = FarPoint.Win.ControlType.Normal;
control.SelectionStart = 2;
control.SelectionLength = 5;
control.Selectable = true;
control.HideSelection = false;
control.AutoMenu = true;
textBox1.Text = control.SelectedText();
control.MaxLength = 9;
control.EditModeCursorPosition = FarPoint.Win.EditModeCursorPosition.LastKnownPosition
control.Text = "This is a test for HideSelection"
control.ControlType = FarPoint.Win.ControlType.Normal
control.SelectionStart = 2
control.SelectionLength = 5
control.Selectable = True
control.HideSelection = False
control.AutoMenu = True
TextBox1.Text = control.SelectedText()
control.MaxLength = 9
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

SuperEditBase Class
SuperEditBase Members
AllowNull Property
SelectionLength Property

 

 


Copyright © GrapeCity, inc. All rights reserved.