这就是我所拥有的:
private void button1_Click(object sender, EventArgs e)
{
//Creating the RichTextBox
RichTextBox rtb = new RichTextBox();
rtb.Location = new Point(20, 20);
rtb.Width = 400;
rtb.Height = 300;
rtb.BackColor = Color.White;
rtb.Font = new Font("Mistral", 16, FontStyle.Regular);
int size = rtb.TextLength;
rtb.AcceptsTab = true;
rtb.ScrollBars = RichTextBoxScrollBars.Both;
rtb.ReadOnly = false;
rtb.MaxLength = rtb.TextLength;
rtb.ShortcutsEnabled = true;
rtb.EnableAutoDragDrop = true;
Controls.Add(rtb);
}
我想使用
来大写用户输入string text = rtb.Text.ToUpper();
rtb.Text = text;
rtb.SelectionStart = rtb.Text.Length;
为了实现这一点,我需要不断地将用户输入到rtb.Text 我怎样才能做到这一点? 提前谢谢。
答案 0 :(得分:0)
有点搞乱:
using (Stream stream = response.GetResponseStream())
{
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
String responseString = reader.ReadToEnd();
}
...或
private void createDynamicRTB()
{
rtb.Location = new Point(20, 20);
rtb.Width = 400;
rtb.Height = 300;
rtb.BackColor = Color.White;
rtb.Font = new Font("Mistral", 16, FontStyle.Regular);
int size = rtb.TextLength;
rtb.AcceptsTab = true;
rtb.ScrollBars = RichTextBoxScrollBars.Both;
rtb.ReadOnly = false;
rtb.MaxLength = rtb.TextLength;
rtb.ShortcutsEnabled = true;
rtb.EnableAutoDragDrop = true;
Controls.Add(rtb);
}
RichTextBox rtb = new RichTextBox();
private void button1_Click(object sender, EventArgs e)
{
//Capitalize
rtb.Text = rtb.Text.ToUpper();
}