C# Class Dev2.CustomControls.Controls.SmartTextBox

A TextBox with support for displaying a list of suggestions when the user misspells a word. The user presses the F1 key to display the list of suggestions.
Documentation: http://www.codeproject.com/KB/WPF/SmartTextBox.aspx
Inheritance: System.Windows.Controls.TextBox
显示文件 Open project: Warewolf-ESB/Warewolf Class Usage Examples

Public Properties

Property Type Description
SuggestionListBoxStyleProperty System.Windows.DependencyProperty

Public Methods

Method Description
GetSpellingError ( ) : System.Windows.Controls.SpellingError

Returns the SpellingError for the word at the current caret index, or null if the current word is not misspelled.

HideSuggestions ( ) : void

Hides the list of suggestions and returns input focus to the input area. If the list of suggestions is not already displayed, nothing happens.

ShowSuggestions ( ) : void

Shows the list of suggestions. If the current word is not misspelled this method does nothing.

Protected Methods

Method Description
OnMouseDown ( System.Windows.Input.MouseButtonEventArgs e ) : void

Hides the list of suggestions.

OnPreviewKeyDown ( System.Windows.Input.KeyEventArgs e ) : void

Shows/hides the list of suggestions.

OnRenderSizeChanged ( System.Windows.SizeChangedInfo sizeInfo ) : void

Ensures that the list of suggestions is hidden when the TextBox is resized.

OnTextChanged ( System.Windows.Controls.TextChangedEventArgs e ) : void

Hides the list of suggestions if a spelling error no longer exists at the current caret location in the TextBox.

Private Methods

Method Description
ApplySelectedSuggestion ( ) : void
AttemptToHideSuggestions ( ) : void
AttemptToShowSuggestions ( ) : void
FindBeginningOfCurrentWord ( ) : int
FindClosestCharacterInCurrentWord ( ) : int
FindEndOfCurrentWord ( ) : int
OnSuggestionListBoxStyleChanged ( DependencyObject depObj, System.Windows.DependencyPropertyChangedEventArgs e ) : void
SmartTextBox ( ) : System
suggestionList_IsKeyboardFocusWithinChanged ( object sender, System.Windows.DependencyPropertyChangedEventArgs e ) : void
suggestionList_ItemContainerGenerator_StatusChanged ( object sender, EventArgs e ) : void
suggestionList_MouseDoubleClick ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
suggestionList_PreviewKeyDown ( object sender, System.Windows.Input.KeyEventArgs e ) : void

Method Details

GetSpellingError() public method

Returns the SpellingError for the word at the current caret index, or null if the current word is not misspelled.
public GetSpellingError ( ) : System.Windows.Controls.SpellingError
return System.Windows.Controls.SpellingError

HideSuggestions() public method

Hides the list of suggestions and returns input focus to the input area. If the list of suggestions is not already displayed, nothing happens.
public HideSuggestions ( ) : void
return void

OnMouseDown() protected method

Hides the list of suggestions.
protected OnMouseDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs
return void

OnPreviewKeyDown() protected method

Shows/hides the list of suggestions.
protected OnPreviewKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs
return void

OnRenderSizeChanged() protected method

Ensures that the list of suggestions is hidden when the TextBox is resized.
protected OnRenderSizeChanged ( System.Windows.SizeChangedInfo sizeInfo ) : void
sizeInfo System.Windows.SizeChangedInfo
return void

OnTextChanged() protected method

Hides the list of suggestions if a spelling error no longer exists at the current caret location in the TextBox.
protected OnTextChanged ( System.Windows.Controls.TextChangedEventArgs e ) : void
e System.Windows.Controls.TextChangedEventArgs
return void

ShowSuggestions() public method

Shows the list of suggestions. If the current word is not misspelled this method does nothing.
public ShowSuggestions ( ) : void
return void

Property Details

SuggestionListBoxStyleProperty public_oe static_oe property

Represents the SuggestionListBoxStyle property. This field is read-only.
public static DependencyProperty,System.Windows SuggestionListBoxStyleProperty
return System.Windows.DependencyProperty