Tablelayoutpanel冻结行像datagridview [英] Tablelayoutpanel frozen row Like datagridview

查看:150
本文介绍了Tablelayoutpanel冻结行像datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

代码项目团队,



我想冻结tablelayoutpanel中的行,以便在滚动时它们不可见。

因为这些行被用作标题而滚动它们会向上移动所以用户无法看到标题。



请帮忙。

感谢和问候

Hello,
codeproject team,

I want to freeze rows in tablelayoutpanel, so that they can not be invisible while scrolling.
because that rows are used as headers while scrolling they goes upward so user can't see titles.

please help.
thanks & regards

推荐答案

不支持。 TableLayoutPanel不是它自己的控件。它是添加到其他控件的扩展。它没有自己的渲染能力。它会告诉其他控件如何定位和调整自己的大小。



为了实现你想要的,你必须有两个或更多的布局控件彼此在内。



例如,第一个TLP将有两行,第一行是你的标题行,第二行是你的细节。



然后第二个TLP将进入顶级TLP的第一行。这可能有一行和一堆包含标题控件的列。



最后,第三个TLP将位于顶级TLP的第二行,包含布置数据详细信息所需的行数和列数。
Not supported. TableLayoutPanel is not a control of it's own. It's an extension added to other controls. It has no rendering capability of it's own. It mearly tells other controls how to position and size themselves.

In order to pull off what you want, you'd have to have two, or more, layout controls inside of each other.

For example, the first TLP would have two rows, the first being your header row and the second being your detail.

Then a second TLP would go inside the first row of the top-level TLP. This will probably have one row and a bunch of columns containing your header controls.

Lastly, the third TLP will be in the second row of the top-level TLP and contain as many rows and columns as required to layout your data details.


对于遇到此类问题的其他人也很有用。

It will also useful to others who have same problem like this.
               TableLayoutPanel---cell(colId,RowId)

                  __________________________
                 |  |      cell(1,0)      <-+--colTblLayoutPnl
                 |__|_______________________|  (AutoScroll=False)
                 |  |                       |
       cell(0,1) |  |      cell(1,1)      <-+--DetailTblLayoutPnl
RowTblLayoutPnl--+> |                       |  (AutoScroll=True)
                 |  |                       |
                 |__|_______________________|



快乐编码!

:)


Happy Coding!
:)


TableLayoutPanel---cell(colId,RowId)

                  __________________________
                 |  |      cell(1,0)      <-+--colTblLayoutPnl
                 |__|_______________________|  (AutoScroll=False)
                 |  |                       |
       cell(0,1) |  |      cell(1,1)      <-+--DetailTblLayoutPnl
RowTblLayoutPnl--+> |                       |  (AutoScroll=True)
                 |  |                       |
                 |__|_______________________|













If we use three tblLayout, two of them is use to define Row header and Column header.
The problem is when we scroll in DetailTable how to make Row header tblLayout and Column header tblLayout scroll ? HScroll ( Row Header tblLayout frezze , column header tblLayout Hscroll ) , VScroll ( Row Header tblLayout Vscroll, column header tblLayout frezze ).


这篇关于Tablelayoutpanel冻结行像datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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