Spread WPF 18
GrapeCity.Wpf.SpreadSheet.CellType.Editors Namespace / GcTextBox Class
Members


In This Topic
    GcTextBox Class
    In This Topic
    Represents a GcTextBox control that can be used to display or edit text with specific format.
    Object Model
    GcTextBox Class
    Syntax
    'Declaration
     
    <DesignTimeVisibleAttribute(False)>
    <ContentPropertyAttribute("Text")>
    <LicenseProviderAttribute(GrapeCity.Common.SpreadLicenseProvider)>
    <TemplateVisualStateAttribute(Name="InsertState", GroupName="EditModeStates")>
    <LocalizabilityAttribute(LocalizationCategory.Text)>
    <TemplatePartAttribute(Name="PART_ContentHost", Type=System.Windows.FrameworkElement)>
    <StyleTypedPropertyAttribute(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)>
    <XmlLangPropertyAttribute("Language")>
    <UsableDuringInitializationAttribute(True)>
    <RuntimeNamePropertyAttribute("Name")>
    <UidPropertyAttribute("Uid")>
    <TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
    <NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
    Public Class GcTextBox 
       Inherits EditBase
    'Usage
     
    Dim instance As GcTextBox
    [DesignTimeVisible(false)]
    [ContentProperty("Text")]
    [LicenseProvider(GrapeCity.Common.SpreadLicenseProvider)]
    [TemplateVisualState(Name="InsertState", GroupName="EditModeStates")]
    [Localizability(LocalizationCategory.Text)]
    [TemplatePart(Name="PART_ContentHost", Type=System.Windows.FrameworkElement)]
    [StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)]
    [XmlLangProperty("Language")]
    [UsableDuringInitialization(true)]
    [RuntimeNameProperty("Name")]
    [UidProperty("Uid")]
    [TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
    [NameScopeProperty("NameScope", System.Windows.NameScope)]
    public class GcTextBox : EditBase 
    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 System.Windows.Controls.Control.HorizontalContentAlignment and System.Windows.Controls.Control.VerticalContentAlignment properties. Aligning the GcTextBox within the layout of the page is done with the System.Windows.FrameworkElement.HorizontalAlignment and System.Windows.FrameworkElement.VerticalAlignment properties.

    The best way to hide the border around a GcTextBox is to set the System.Windows.Controls.Control.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 System.Windows.Controls.ScrollBarVisibility.Visible or System.Windows.Controls.ScrollBarVisibility.Auto.

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

    Supported System.Windows.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 System.Windows.UIElement.IsEnabled is false.

    CommonStates

    ReadOnly

    Represents the visual appearance when IsReadOnly is true.

    CommonStates

    MouseOver

    Represents the visual appearance when System.Windows.UIElement.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.

    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Media.Visual
                System.Windows.UIElement
                   System.Windows.FrameworkElement
                      System.Windows.Controls.Control
                         GrapeCity.Wpf.SpreadSheet.CellType.Editors.ControlBase
                            GrapeCity.Wpf.SpreadSheet.CellType.Editors.EditBase
                               GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox

    See Also