本文整理汇总了C#中System.Windows.Forms.RichTextBox.CreateControl方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.RichTextBox.CreateControl方法的具体用法?C# System.Windows.Forms.RichTextBox.CreateControl怎么用?C# System.Windows.Forms.RichTextBox.CreateControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RichTextBox
的用法示例。
在下文中一共展示了System.Windows.Forms.RichTextBox.CreateControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditBox
protected System.Drawing.Rectangle textRect; // Bounding rectangle for the text
#endregion Fields
#region Constructors
/// <summary>Creates a new edit box control</summary>
public EditBox(Dialog parent)
: base(parent)
{
controlType = ControlType.EditBox;
parentDialog = parent;
border = 5; // Default border
spacing = 4; // default spacing
isCaretOn = true;
textData = new System.Windows.Forms.RichTextBox();
// Create the control
textData.Visible = true;
textData.Font = new System.Drawing.Font("Arial", 8.0f);
textData.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
textData.Multiline = false;
textData.Text = string.Empty;
textData.MaxLength = ushort.MaxValue; // 65k characters should be plenty
textData.WordWrap = false;
// Now create the control
textData.CreateControl();
isHidingCaret = false;
firstVisible = 0;
blinkTime = NativeMethods.GetCaretBlinkTime() * 0.001f;
lastBlink = FrameworkTimer.GetAbsoluteTime();
textColor = new ColorValue(0.06f, 0.06f, 0.06f, 1.0f);
selectedTextColor = new ColorValue(1.0f, 1.0f, 1.0f, 1.0f);
selectedBackColor = new ColorValue(0.15f, 0.196f, 0.36f, 1.0f);
caretColor = new ColorValue(0, 0, 0, 1.0f);
caretPosition = textData.SelectionStart = 0;
isInsertMode = true;
isMouseDragging = false;
}