问题描述
我发现 c# (.net 2.0) 中的表格布局面板非常原始.我想让我的用户在表格布局面板中调整列的大小,但没有现成的选项可以这样做.有没有办法至少找出光标是否直接在单元格的任何边界上,如果是,哪个单元格在它下面?可能有这些信息,我们至少可以尝试通过代码调整该行/列的大小.帮我找,
I find the table layout panel in c# (.net 2.0) to be very primitive. I wanted to allow my users to resize the columns in a table layout panel but there are no ready made options to do so. Is there a way atleast to find out whether the cursor is directly over any borders of a cell and if so, which cell is beneath it ?? May be having this information, we can atleast try resizing that row/column thru' code. Help me finding,
- 光标是否直接位于单元格的任何边框上
- 下面是哪个单元格(仅当第一个问题有答案时才适用)
非常感谢,
苏达桑·斯里尼瓦桑
推荐答案
如果你的布局不是过于复杂,也许你可以使用 SplitContainer 控件?不幸的是,每个 SplitContainer 将只有两个单元格",但您可以在另一个 SplitContiner 面板中嵌入一个 SplitContainer 以获得更多可调整大小的单元格:
If your layout is not overly complex, maybe you can achieve what you want by using SplitContainer controls? Unfortunately, each SplitContainer will have only two "cells", but you can embed a SplitContainer in another SplitContiner panel to get more resizable cells:
┌──────────────────┐
│┌─────┬──────────┐│
││ │ ││
││ │ ││
│└─────┴──────────┘│
├──────────────────┤
│┌──────────┬─────┐│
││ │ ││
││ │ ││
│└──────────┴─────┘│
└──────────────────┘
好的,所以 ASCII 艺术从来都不是我的强项之一,但我想你明白了 ;o)
OK, so ASCII art was never one of my stronger skills, but I think you get the point ;o)
这篇关于c# 中可调整大小的表格布局面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!