-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdLibField.cs
More file actions
30 lines (27 loc) · 960 Bytes
/
AdLibField.cs
File metadata and controls
30 lines (27 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Windows;
using System.Windows.Controls;
public class AdLibField
{
public TextBlock textBlock;
public TextBox textBox;
public AdLibField(string labelText)
{
textBlock = new TextBlock();
textBlock.Text = labelText;
textBox = new TextBox();
// set language for textbox to english
textBox.Language = System.Windows.Markup.XmlLanguage.GetLanguage("en-US");
// enable spell checking
textBox.SpellCheck.IsEnabled = true;
// set textbox width to 200
textBox.Width = 200;
// align textbox to left
textBox.HorizontalAlignment = HorizontalAlignment.Left;
// allow textblock to word wrap
textBlock.TextWrapping = TextWrapping.Wrap;
// padding
textBlock.Padding = new Thickness(5, 4, 0, 1);
textBlock.FontFamily = new System.Windows.Media.FontFamily("Times New Roman");
textBlock.FontSize = 16;
}
}