 <p><strong># first method :</strong> create a class with name customTextbox.cs and write down properties and events for textbox</p> <pre><code>public class customTextbox:TextBox { public customTextbox():base() { this.AcceptsReturn = true; this.AllowDrop = true; this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; //set your remaining propreties this.PreviewDragEnter +=customTextbox_PreviewDragEnter; this.PreviewDragLeave +=customTextbox_PreviewDragLeave; this.SelectionChanged += customTextbox_SelectionChanged; } void customTextbox_SelectionChanged(object sender, System.Windows.RoutedEventArgs e) { //code here } private void customTextbox_PreviewDragLeave(object sender, System.Windows.DragEventArgs e) { //code here } private void customTextbox_PreviewDragEnter(object sender, System.Windows.DragEventArgs e) { //code here } } </code></pre> <p>and in xaml</p> <pre><code>&lt;Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:hp="clr-namespace:WpfApplication3"&gt; &lt;Grid Background="Transparent"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition&gt;&lt;/RowDefinition&gt; &lt;RowDefinition&gt;&lt;/RowDefinition&gt; &lt;RowDefinition&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;hp:customTextbox Height="100" Width="100" Grid.Row="0"&gt;&lt;/hp:customTextbox&gt; &lt;hp:customTextbox Grid.Row="1" &gt;&lt;/hp:customTextbox&gt; &lt;hp:customTextbox Grid.Row="2" &gt;&lt;/hp:customTextbox&gt; &lt;/Grid&gt; </code></pre> <p></p> <p><strong>#second method</strong>:create a usecontrol like this(<a href="http://prntscr.com/2mren4" rel="nofollow">http://prntscr.com/2mren4</a>) and replace usercontrol with textbox like below</p> <pre><code>&lt;TextBox x:Class="WpfApplication3.CustomTB" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"&gt; &lt;!--set all properties and event you required inside textbox--&gt; </code></pre> <p>and in .cs file use textbox instead of usercontrol like below</p> <pre><code> public partial class CustomTB : TextBox { public CustomTB() { InitializeComponent(); } } </code></pre> <p>and in another window add </p> <pre><code>&lt;Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:hp="clr-namespace:WpfApplication3"&gt; &lt;Grid Background="Transparent"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition&gt;&lt;/RowDefinition&gt; &lt;RowDefinition&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;hp:CustomTB Grid.Row="0"/&gt; &lt;/Grid&gt; </code></pre> <p></p>