winform技巧一,errorprovider,任务栏可见,总在最前
????????{
????????????this.ShowInTaskbar?=?false;//確定窗體是否在任務欄可見
????????????this.TopMost?=?true;//確定窗體總在最前顯示,盡管沒有獲得焦點
????????}
private void textBox1_Validating(object sender, CancelEventArgs e)
??????? {
??????????? if (textBox1.TextLength < 5)
??????????? {
??????????????? errorProvider1.SetError((Control)sender, "input must more than 5.");
??????????????? textBox1.SelectAll();
??????????????? e.Cancel = true;
??????????? }
??????????? else
??????????? {
??????????????? errorProvider1.SetError((Control)sender, "");
??????????? }
??????? }
??????? private void button1_Click(object sender, EventArgs e)
??????? {
??????????? for (int i = 1; i < 1000; i++)
??????????? {
??????????????? this.progressBar1.Value++;
???????????????
??????????????? this.label1.Refresh();this.label1.Text = Convert.ToString(progressBar1.Value);
??????????? }
??????? }
轉載于:https://www.cnblogs.com/virusswb/articles/1206887.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的winform技巧一,errorprovider,任务栏可见,总在最前的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 就这么被微软抛弃了
- 下一篇: .NET访问PI数据库