如何将datagridview的大小上升到左侧 [英] how to rising size of datagridview to the left

查看:108
本文介绍了如何将datagridview的大小上升到左侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的表格中有一个datagridview和一个按钮。

当我点击按钮时,datagridview的大小增加50个单位(datagridview1.Width + = 50)

我的datagridview增长到了正确,但我想要成长为离开。

(我的表格是righttoleft,Anchor设置为左右顶部)



如何将datagridview的大小上升到左边?

Hi I have a datagridview and a button in my form.
when I click on the button, size of datagridview increase 50 units(datagridview1.Width+=50)
my datagridview grow to right, but I want grow to left.
(my form is righttoleft and Anchor is set to left and right and top)

how to rising size of datagridview to the left?

推荐答案

您需要在宽度的同时更改Left属性,因为Anchor属性与现有的Left和Width属性一起使用my teh Resize事件:

You need to change the Left property at the same time as the Width since teh Anchor property is used in conjunction with the existing Left and Width properties my teh Resize event:
myDataGridView.Width += 50;
myDataGridView.Left -= 50;

但请先检查它是否合适!

But do check it fits first!


这篇关于如何将datagridview的大小上升到左侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆