winform Label与DataGridView右对齐

时间:2014-05-20 13:53:04   收藏:0   阅读:417

实现Label与DataGridView对齐有两种方法,差别不大:

定义:

Label名称:lblName

DataGridView名称:dgvData

第一种:

 lblName.Location = new Point(dgvData.Location.X + dgvData.Width - lblName.Width, lblName.Location.Y);

第二种:

 lblName.Location = new System.Drawing.Point(dgvData.Location.X + dgvData.Width - lblName.Width, lblName.Location.Y);

winform Label与DataGridView右对齐,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!