本文整理汇总了C#中System.Windows.Forms.RichTextBox.SetBounds方法的典型用法代码示例。如果您正苦于以下问题:C# RichTextBox.SetBounds方法的具体用法?C# RichTextBox.SetBounds怎么用?C# RichTextBox.SetBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RichTextBox
的用法示例。
在下文中一共展示了RichTextBox.SetBounds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1
public Form1()
{
InitializeComponent();
richtxt = new RichTextBox();
richtxt.Parent = this.panel1;
richtxt.SetBounds(0, 0, this.panel1.Width, this.panel1.Height);
richtxt.Visible = false;
Timer timer = new Timer();
timer.Interval = 1000;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
示例2: ScrollableMsgBox
public static void ScrollableMsgBox(string promptText, string title)
{
Form form = new Form();
RichTextBox txtMessage = new RichTextBox();
Button buttonOk = new Button();
txtMessage.Text = promptText;
txtMessage.Enabled = true;
txtMessage.Multiline = true;
txtMessage.ReadOnly = true;
buttonOk.Text = "OK";
buttonOk.DialogResult = DialogResult.OK;
txtMessage.SetBounds(5, 5, 450, 215);
buttonOk.SetBounds(190, 225, 75, 23);
txtMessage.AutoSize = true;
buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
form.Text = title;
form.ClientSize = new Size(450, 250);
form.Controls.AddRange(new Control[] { txtMessage, buttonOk });
form.ClientSize = new Size(Math.Max(300, txtMessage.Right + 5), form.ClientSize.Height);
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.StartPosition = FormStartPosition.CenterScreen;
form.AcceptButton = buttonOk;
form.ShowDialog();
}