added samples
[windows-sources.git] / sdk / samples / WPFSamples / TextBoxBase_AutoWordSelection / visualbasic / window1.xaml.vb
blob24cf2a896fb4cc18e9634d3b3455a2385ce01d2d
1 Imports System
2 Imports System.Windows
3 Imports System.Windows.Controls
4 Imports System.IO
6 Namespace SDKSample
8 Partial Public Class Window1
9 Inherits Window
11 Public Sub windowLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
12 InitializeComponent()
13 myCheckBox.IsChecked = False
14 myTextBox.AutoWordSelection = False
15 LoadSampleContent()
16 End Sub
17 Public Sub AutoWordSelectionToggle(ByVal sender As Object, ByVal args As RoutedEventArgs)
18 myTextBox.AutoWordSelection = myCheckBox.IsChecked.Value
19 End Sub
20 Public Sub LoadSampleContent()
21 'Assumes sample content file is in the root project folder, and that
22 'the project exectutable will be in bin\debug relative to the root
23 'project folder. Tweak as necessary.
24 Dim relativePathAndFileName As String = "..\\..\\sample_content.txt"
25 Dim fileToLoad As New StreamReader(relativePathAndFileName)
26 myTextBox.Text = fileToLoad.ReadToEnd()
27 fileToLoad.Close()
28 End Sub
29 End Class
30 End Namespace