[]
        
(Showing Draft Content)

GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox

GcTextBox Class

Represents a GcTextBox control that can be used to display or edit text with specific format.

Namespace: GrapeCity.Wpf.SpreadSheet.CellType.Editors
Assembly: GrapeCity.Wpf.SpreadSheet.CellType.dll
Syntax
[TemplateVisualState(Name = "InsertState", GroupName = "EditModeStates")]
[TemplateVisualState(Name = "OverwriteState", GroupName = "EditModeStates")]
public class GcTextBox : EditBase, IAnimatable, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, ISupportInitialize
<TemplateVisualState(Name:="InsertState", GroupName:="EditModeStates")>
<TemplateVisualState(Name:="OverwriteState", GroupName:="EditModeStates")>
Public Class GcTextBox
    Inherits EditBase
    Implements IAnimatable, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, ISupportInitialize
Remarks

The GcTextBox is a composite control that that is composed of several encapsulated components. Consequently, some events do not bubble up to the containing control because they are handled by encapsulated child elements. Because of this, application developers should listen for the tunneling version of an event (denoted by the prefix "Preview").

GcTextBox supports unformatted and formatted text.

Horizontally and vertically aligning text within a GcTextBox is done with the HorizontalContentAlignment and VerticalContentAlignment properties. Aligning the GcTextBox within the layout of the page is done with the HorizontalAlignment and VerticalAlignment properties.

The best way to hide the border around a GcTextBox is to set the BorderThickness property of the GcTextBox to 0.

Scrollbars are not visible on a GcTextBox by default. To make scrollbars visible, set the VerticalScrollBarVisibility and HorizontalScrollBarVisibility properties to Visible or Auto.

Usually the TextChanged event should be used to detect whenever the text in a GcTextBox changes rather then KeyDown as you might expect.

Supported VisualState list:

l

VisualStateGroup Name

VisualState Name

Description

CommonStates

Normal

Represents the visual appearance when control is in normal state.

CommonStates

Disabled

Represents the visual appearance when IsEnabled is false.

CommonStates

ReadOnly

Represents the visual appearance when IsReadOnly is true.

CommonStates

MouseOver

Represents the visual appearance when IsMouseOver is true.

ActiveStates

Active

Represents the visual appearance when IsActive is true.

ActiveStates

Inactive

Represents the visual appearance when IsActive is false.

ValidationStates

Valid

Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns false.

ValidationStates

InvalidFocused

Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and control has focus.

ValidationStates

InvalidUnfocused

Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and control has no focus.

Constructors

Name Description
GcTextBox()

Initializes a new instance of the GcTextBox class.

Fields

Name Description
AcceptsCrLfProperty

Identifies the AcceptsCrLf dependency property.

AcceptsReturnProperty

Identifies the AcceptsReturn dependency property.

AcceptsTabProperty

Identifies the AcceptsTab dependency property.

AutoConvertProperty

Identifies the AutoConvert dependency property.

AutoWordSelectionProperty

Identifies the AutoWordSelection dependency property.

CountWrappedLineProperty

Identifies the CountWrappedLine dependency property.

EllipsisProperty

Identifies the Ellipsis dependency property.

EllipsisStringProperty

Identifies the EllipsisString dependency property.

ExitOnLastCharProperty

Identifies the ExitOnLastChar dependency property.

FormatProperty

Identifies the Format dependency property.

GridLineBrushProperty

Identifies the GridLineBrush dependency property.

GridLineStyleProperty

Identifies the GridLineStyle dependency property.

HighlightTextProperty

Identifies the HighlightText dependency property.

HorizontalScrollBarVisibilityProperty

Identifies the HorizontalScrollBarVisibility dependency property.

MaxLengthProperty

Identifies the MaxLength dependency property.

MaxLengthUnitProperty

Identifies the MaxLengthUnit dependency property.

MaxLineCountProperty

Identifies the MaxLineCount dependency property.

MaxLinesProperty

Identifies the MaxLines dependency property.

MinLinesProperty

Identifies the MinLines dependency property.

MultilineProperty

Identifies the Multiline dependency property.

RecommendedValueProperty

Identifies the GrapeCity.Windows.InputMan.GcTextBox.RecommendedValue dependency property.

ShowOverflowTipProperty

Identifies the ShowOverflowTip dependency property.

ShowRecommendedValueProperty

Identifies the GrapeCity.Windows.InputMan.GcTextBox.ShowRecommendedValue dependency property.

TextWrappingProperty

Identifies the TextWrapping dependency property.

VerticalScrollBarVisibilityProperty

Identifies the VerticalScrollBarVisibility dependency property.

WatermarkDisplayNullForegroundProperty

Identifies the GrapeCity.Windows.InputMan.GcTextBox.WatermarkDisplayNullForeground dependency property.

WatermarkDisplayNullProperty

Identifies the GrapeCity.Windows.InputMan.GcTextBox.WatermarkDisplayNull dependency property.

WatermarkNullForegroundProperty

Identifies the GrapeCity.Windows.InputMan.GcTextBox.WatermarkNullForeground dependency property.

WatermarkNullProperty

Identifies the GrapeCity.Windows.InputMan.GcTextBox.WatermarkNull dependency property.

Properties

Name Description
AcceptsCrLf

Gets or sets a value indicating how to process the CrLf chars when pasting string. This is a dependency property.

AcceptsReturn

Gets or sets a value indicating whether pressing ENTER in a multiline GcTextBox control creates a new line of text in the control. This is a dependency property.

AcceptsTab

Gets or sets a value that indicates how the text editing control responds when the user presses the TAB key. This is a dependency property.

ApplyRecommendedValueCommand

Represents the ApplyRecommendedValueCommand command, which requests that recommended value be applied.

AutoConvert

Gets or sets whether to automatically convert the entered characters according to the input mask. This is a dependency property.

AutoWordSelection

Gets or sets a value that determines whether when a user selects part of a word by dragging across it with the mouse, the rest of the word is selected. This is a dependency property.

ClearCommand

Represents the ClearCommand command, which requests that GcTextBox to clear all the text.

CountWrappedLine

Gets or sets a bool value that indicates whether to count the wrapped line when limit the count of lines counted by MaxLineCount property. This is a dependency property.

Ellipsis

Gets or sets a value indicating how the ellipsis character (...) appears, denoting that the GcTextBox text extends beyond the specified length of the GcTextBox. This is a dependency property.

EllipsisString

Gets or sets what is shown as ellipsis when width of text is longer than control. This is a dependency property.

ExitOnLastChar

Gets or sets whether or not the next control in the tab order receives the focus as soon as the control is filled at the last character. This is a dependency property.

Format

Gets or sets the input format to use in the control. This is a dependency property.

GridLineBrush

Gets or sets a Brush used to paint the grid lines. This is a dependency property.

GridLineStyle

Gets or sets a GrapeCity.Windows.InputMan.LineStyle enumeration value that indicates the grid line style for each lines. This is a dependency property.

HighlightText

Gets or sets whether to highlight text in the control. This is a dependency property.

HorizontalScrollBarVisibility

Gets or sets a value that indicates whether a horizontal scroll bar is shown. This is a dependency property.

LineCount

Gets the total number of lines in the text box.

MaxLength

Gets or sets the maximum number of characters or bytes that the control can hold. This is a dependency property.

MaxLengthUnit

Gets or sets whether the maximum number of characters that can hold in the control are handled based on bytes, characters or text elements. This is a dependency property.

MaxLineCount

Gets or sets the maximum counts of acceptable lines.

MaxLines

Gets or sets the maximum number of visible lines. This is a dependency property.

MinLines

Gets or sets the minimum number of visible lines. This is a dependency property.

Multiline

Gets or sets whether the control can accept and display multiple lines of text.

RecommendedValue

Gets or sets the recommended value.

ShowOverflowTip

Gets or set whether to show overflow tooltip.

ShowRecommendedValue

Gets or sets a value indicating whether show the recommended value.

TextWrapping

Gets or sets how the text box should wrap text. This is a dependency property.

VerticalScrollBarVisibility

Gets or sets a value that indicates whether a vertical scroll bar is shown. This is a dependency property.

WatermarkDisplayNull

Gets or sets the watermark display text when the value is null and GcTextBox is not active.

WatermarkDisplayNullForeground

Gets or sets the foreground of the watermark display text when WatermarkDisplayNull shows.

WatermarkNull

Gets or sets the watermark text when the value is null.

WatermarkNullForeground

Gets or sets the foreground of the watermark text when the value is null.

Methods

Name Description
GetCharacterIndexFromLineIndex(int)

Returns the zero-based character index for the first character in the specified line.

GetCharacterIndexFromPoint(Point, bool)

Returns the zero-based insertion index for the specified point.

GetFirstVisibleLineIndex()

Returns the line index for the first line that is currently visible in the text box.

GetLastVisibleLineIndex()

Returns the line index for the last line that is currently visible in the text box.

GetLineIndexFromCharacterIndex(int)

Returns the zero-based line index for the line that contains the specified character index.

GetLineLength(int)

Returns the number of characters in the specified line.

GetLineText(int)

Returns the text that is currently displayed on the specified line.

GetRectFromCharacterIndex(int)

Returns the rectangle for the leading edge of the character at the specified index.

GetRectFromCharacterIndex(int, bool)

Returns the rectangle for the leading or trailing edge of the character at the specified index.

LineDown()

Scrolls the contents of the control down by one line.

LineLeft()

Scrolls the contents of the control to the left by one line.

LineRight()

Scrolls the contents of the control to the right by one line.

LineUp()

Scrolls the contents of the control upward by one line.

OnIsActiveChanged(RoutedEventArgs)

Called when IsActive property changed.

PageDown()

Scrolls the contents of the control down by one page.

PageLeft()

Scrolls the contents of the control to the left by one page.

PageRight()

Scrolls the contents of the control to the right by one page.

PageUp()

Scrolls the contents of the control up by one page.

ScrollToEnd()

Scrolls the view of the editing control to the end of the content.

ScrollToHome()

Scrolls the view of the editing control to the beginning of the viewport.

ScrollToHorizontalOffset(double)

Scrolls the contents of the editing control to the specified horizontal offset.

ScrollToLine(int)

Scrolls the line at the specified line index into view.

ScrollToVerticalOffset(double)

Scrolls the contents of the editing control to the specified vertical offset.