forked from DebugST/STTextBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrmWrapView.cs
More file actions
52 lines (46 loc) · 1.72 KB
/
FrmWrapView.cs
File metadata and controls
52 lines (46 loc) · 1.72 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ST.Library.UI.STTextBox;
namespace STTextBoxTest.Demos
{
public partial class FrmWrapView : Form
{
public FrmWrapView() {
InitializeComponent();
}
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
var textView = new WrapTextView(); //default: word, left
textView.ShowLineNumber = true; //default: true
textView.SetWrap(WrapTextView.Method.Word, WrapTextView.Alignment.Left);
textView.ShowLineNumberGuide = true; //default: true
textView.LineNumberGuideColor = Color.Magenta; //default: Magenta
STTextBox tbx = new STTextBox();
tbx.SetTextView(textView);
tbx.SetTextStyleMonitors(new CSharpStyleMonitor());
tbx.Dock = DockStyle.Fill;
tbx.Font = new System.Drawing.Font("Consolas", 10);
this.Controls.Add(tbx);
string strCode = @"
//this is code
var textView = new WrapTextView(); //default: word, left
textView.ShowLineNumber = true; //default: true
textView.SetWrap(WrapTextView.Method.Word, WrapTextView.Alignment.Left);
textView.ShowLineNumberGuide = true; //default: true
textView.LineNumberGuideColor = Color.Magenta; //default: Magenta
STTextBox tbx = new STTextBox();
tbx.SetTextView(textView);
tbx.SetTextStyleMonitors(new CSharpStyleMonitor());
tbx.Dock = DockStyle.Fill;
tbx.Font = new System.Drawing.Font(""Consolas"", 10);
this.Controls.Add(tbx);";
tbx.SetText(strCode.Trim());
}
}
}