Mega Code Archive
TextBox Selection start, end and selected text
this is a test
//File:Window.xaml.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace ClassicControls
{
public partial class TextBoxTest : System.Windows.Window
{
public TextBoxTest()
{
InitializeComponent();
}
private void txt_SelectionChanged(object sender, RoutedEventArgs e)
{
Console.WriteLine(txt.SelectionStart);
Console.WriteLine(txt.SelectionLength);
Console.WriteLine(txt.SelectedText);
}
}
}