SpellCheck.IsEnabled ="True" AcceptsReturn ="True" Name ="txtData">
//File:Window.xaml.vb Imports System Imports System.Collections.Generic Imports System.Text Imports System.Windows Imports System.Windows.Controls Imports System.Windows.Data Imports System.Windows.Documents Imports System.Windows.Input Imports System.Windows.Media Imports System.Windows.Media.Imaging Imports System.Windows.Shapes Namespace WpfApplication1 Public Partial Class MainWindow Inherits System.Windows.Window Public Sub New() InitializeComponent() SetF1CommandBinding() End Sub Protected Sub FileExit_Click(sender As Object, args As RoutedEventArgs) Application.Current.Shutdown() End Sub Protected Sub ToolsSpellingHints_Click(sender As Object, args As RoutedEventArgs) Dim spellingHints As String = String.Empty Dim [error] As SpellingError = txtData.GetSpellingError(txtData.CaretIndex) If [error] IsNot Nothing Then For Each s As String In [error].Suggestions spellingHints += String.Format("{0}" & vbLf, s) Next lblSpellingHints.Content = spellingHints expanderSpelling.IsExpanded = True End If End Sub Protected Sub MouseEnterExitArea(sender As Object, args As RoutedEventArgs) statBarText.Text = "Exit the Application" End Sub Protected Sub MouseEnterToolsHintsArea(sender As Object, args As RoutedEventArgs) statBarText.Text = "Spelling Suggestions" End Sub Protected Sub MouseLeaveArea(sender As Object, args As RoutedEventArgs) statBarText.Text = "Ready" End Sub Private Sub SetF1CommandBinding() Dim helpBinding As New CommandBinding(ApplicationCommands.Help) AddHandler helpBinding.CanExecute, AddressOf CanHelpExecute AddHandler helpBinding.Executed, AddressOf HelpExecuted CommandBindings.Add(helpBinding) End Sub Private Sub CanHelpExecute(sender As Object, e As CanExecuteRoutedEventArgs) e.CanExecute = True End Sub Private Sub HelpExecuted(sender As Object, e As ExecutedRoutedEventArgs) MessageBox.Show("type something!", "Help!") End Sub End Class End Namespace