【问题标题】:Location by code. C#按代码定位。 C#
【发布时间】:2014-01-18 20:26:25
【问题描述】:

我想将 dataGridView 的 Y 位置更改为 75,我试图通过单击按钮将其向上移动。

已经试过了

this.dataGridView1.Location = new Point(
 this.dataGridView1.Location.X,
 this.dataGridView1.Location.Y
);

【问题讨论】:

    标签: c# datagridview location


    【解决方案1】:

    大概你的意思是:

    this.dataGridView1.Location = new Point(this.dataGridView1.Location.X, 75);
    

    【讨论】:

      【解决方案2】:

      稍后再说 this.dataGridView1.Top = 75;

      【讨论】:

        【解决方案3】:

        试试这个:

        dataGridView1.Left = 58; //X coordinate
        dataGridView1.Top  = 57; //Y coordinate
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多