
正文
c# winfrom 界面设计
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
1.在用DotnetBar的RibbonControl时,界面最大化时,会把电脑桌面的任务栏遮盖住;
解决办法:在load事件中写入:
this.MaximumSize = new System.Drawing.Size(Screen.PrimaryScreen.WorkingArea.Width + , Screen.PrimaryScreen.WorkingArea.Height + );
2.dataGridView表头字段过多时,自适应宽度:
ColumnHeadersDefaultCellStyle 这个属性默认是TRUE,改成NotSet
3.滑动滚动条,两个dataGridView同步滚动
private void Dgv_Scroll(object sender, ScrollEventArgs e)
{
dgv_total.FirstDisplayedScrollingRowIndex = Dgv.FirstDisplayedScrollingRowIndex; dgv_total.HorizontalScrollingOffset = Dgv.HorizontalScrollingOffset;
} private void dgv_total_Scroll(object sender, ScrollEventArgs e)
{
Dgv.FirstDisplayedScrollingRowIndex = dgv_total.FirstDisplayedScrollingRowIndex; Dgv.HorizontalScrollingOffset = dgv_total.HorizontalScrollingOffset;
}







