zoukankan      html  css  js  c++  java
  • C#之显示效果

    窗体最大化(包含任务栏):

    1 this.TopMost = true;
    2 this.Location = new Point(0, 0);
    3 this.Size = Screen.PrimaryScreen.Bounds.Size;

    窗体最大化(不包含任务栏):

    1 this.Location = new Point(0, 0);
    2 this.Size = Screen.PrimaryScreen.WorkingArea.Size;

    textbox滚动到最下端:

    1 textBox.SelectionStart = textBox.TextLength - 1;
    2 textBox.ScrollToCaret();

    DatagridView滚动到最下:

    1 //计算dataGridView1可显示的最多行数
    2 int count = (dataGridView1.Height - dataGridView1.RowHeadersWidth) / dataGridView1.Rows[0].Height;
    3 //设定最上端的显示行
    4 dataGridView1.FirstDisplayedScrollingRowIndex = num - count;

    TabControl页面切换

     1    private void btnPage1_Click(object sender, EventArgs e)
     2    {
     3        tabPage1.Parent = this.tabControl1;
     4        tabPage2.Parent = null;
     5    }
     6 
     7    private void btnPage2_Click(object sender, EventArgs e)
     8    {
     9        tabPage1.Parent = null;
    10        tabPage2.Parent = this.tabControl1;
    11    }
  • 相关阅读:
    继承
    面向对象
    数据库的数据操作
    数据库数据类型以及建库语句
    第一天
    继承与多态
    C#面向对象——对象成员、方法重载、引用类库等
    C#面向对象初步
    SQL2008知识回顾
    C#知识回顾
  • 原文地址:https://www.cnblogs.com/imstrive/p/5779063.html
Copyright © 2011-2022 走看看