无法在运行时访问 RowSpan 属性?

发布于 2024-09-27 06:49:23 字数 164 浏览 1 评论 0原文

当我将列表框放入 TableLayout 的单元格中时,它具有 ColumnSpan 和 RowSpan 的属性...但是当我转到代码并想说“ listBox1.RowSpan ”时,没有这样的属性:( 我想这样做是因为有时在我的程序中我希望这个列表框占据一个单元格,有时我希望它占据两个单元格,所以我该怎么做呢?

when I drop a Listbox in a cell of a TableLayout, it has the properties for ColumnSpan and RowSpan ... but when I go to the code and want to say " listBox1.RowSpan " there is not such a property :( I want to do this because sometimes in my program I want this listbox to take one cell and sometimes I want it to take two cells. so How can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮邮递员 2024-10-04 06:49:23

为了以编程方式更改 RowSpan,您必须执行以下操作:

tableLayoutPanel1.SetRowSpan(listBox1, 2);

并将所需的行数放在我放置 2 的位置。

In order to change the RowSpan programmatically, you have to do the following:

tableLayoutPanel1.SetRowSpan(listBox1, 2);

And put the desired number of rows where I put the 2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文