草庐IT

textBox1

全部标签

c# - textbox.Focus() 在 C# 中不起作用

我想知道为什么这段代码无法聚焦文本框...?privatevoidsendEmail_btn_Click(objectsender,EventArgse){StringsendTo=recipientEmail_tbx.Text.Trim();if(!IsValidEmailAddress(sendTo)){MessageBox.Show("PleaseEntervalidEmailaddress","Cognex"MessageBoxButtons.OK,MessageBoxIcon.Error);recipientEmail_tbx.Focus();}}

c# - textbox.Focus() 在 C# 中不起作用

我想知道为什么这段代码无法聚焦文本框...?privatevoidsendEmail_btn_Click(objectsender,EventArgse){StringsendTo=recipientEmail_tbx.Text.Trim();if(!IsValidEmailAddress(sendTo)){MessageBox.Show("PleaseEntervalidEmailaddress","Cognex"MessageBoxButtons.OK,MessageBoxIcon.Error);recipientEmail_tbx.Focus();}}

c# - 如何向多行文本框添加一行?

如何向multi-line添加一行文本TextBox?例如伪代码;textBox1.Clear();textBox1.Lines.Add("1000+");textBox1.Lines.Add("750-999");textBox1.Lines.Add("400-749");...snip...textBox1.Lines.Add("40-59");或textBox1.Lines.Append("brown");textBox1.Lines.Append("brwn");textBox1.Lines.Append("brn");textBox1.Lines.Append("brow")

c# - 如何向多行文本框添加一行?

如何向multi-line添加一行文本TextBox?例如伪代码;textBox1.Clear();textBox1.Lines.Add("1000+");textBox1.Lines.Add("750-999");textBox1.Lines.Add("400-749");...snip...textBox1.Lines.Add("40-59");或textBox1.Lines.Append("brown");textBox1.Lines.Append("brwn");textBox1.Lines.Append("brn");textBox1.Lines.Append("brow")

c# - 从另一个线程写入 TextBox?

这个问题在这里已经有了答案:HowdoIupdatetheGUIfromanotherthread?(47个回答)Cross-threadoperationnotvalid:Controlaccessedfromathreadotherthanthethreaditwascreatedon(22个答案)关闭去年。我不知道如何让C#Windows窗体应用程序从线程写入文本框。例如,在Program.cs中,我们有标准的main()来绘制表单:staticvoidMain(){Application.EnableVisualStyles();Application.SetCompatibl

c# - 从另一个线程写入 TextBox?

这个问题在这里已经有了答案:HowdoIupdatetheGUIfromanotherthread?(47个回答)Cross-threadoperationnotvalid:Controlaccessedfromathreadotherthanthethreaditwascreatedon(22个答案)关闭去年。我不知道如何让C#Windows窗体应用程序从线程写入文本框。例如,在Program.cs中,我们有标准的main()来绘制表单:staticvoidMain(){Application.EnableVisualStyles();Application.SetCompatibl

c# - 滚动到 C# TextBox 的底部

这个问题在这里已经有了答案:HowdoIautomaticallyscrolltothebottomofamultilinetextbox?(13个答案)关闭9年前。我在C#Forms应用程序上有一个TextBox。我用有关窗体的Load事件的信息填充TextBox。然后我调用以下内容:this.txtLogEntries.SelectionStart=txtLogEntries.Text.Length;this.txtLogEntries.ScrollToCaret();但是TextBox没有滚动到底部?不过这仅适用于Load事件。一旦它运行,我也会从应用程序的其他部分更新此Text

c# - 滚动到 C# TextBox 的底部

这个问题在这里已经有了答案:HowdoIautomaticallyscrolltothebottomofamultilinetextbox?(13个答案)关闭9年前。我在C#Forms应用程序上有一个TextBox。我用有关窗体的Load事件的信息填充TextBox。然后我调用以下内容:this.txtLogEntries.SelectionStart=txtLogEntries.Text.Length;this.txtLogEntries.ScrollToCaret();但是TextBox没有滚动到底部?不过这仅适用于Load事件。一旦它运行,我也会从应用程序的其他部分更新此Text

c# - TextBox.TextChanged 事件在 Windows Phone 7 模拟器上触发两次

我有一个非常简单的测试应用程序,只是为了玩转WindowsPhone7。我刚刚向标准UI模板添加了一个TextBox和一个TextBlock。唯一的自定义代码如下:publicpartialclassMainPage:PhoneApplicationPage{publicMainPage(){InitializeComponent();}privateintcounter=0;privatevoidTextBoxChanged(objectsender,TextChangedEventArgse){textBlock1.Text+="Textchanged"+(counter++)+"

c# - TextBox.TextChanged 事件在 Windows Phone 7 模拟器上触发两次

我有一个非常简单的测试应用程序,只是为了玩转WindowsPhone7。我刚刚向标准UI模板添加了一个TextBox和一个TextBlock。唯一的自定义代码如下:publicpartialclassMainPage:PhoneApplicationPage{publicMainPage(){InitializeComponent();}privateintcounter=0;privatevoidTextBoxChanged(objectsender,TextChangedEventArgse){textBlock1.Text+="Textchanged"+(counter++)+"