Resizable table layout panel in c#(c# 中可调整大小的表格布局面板)
问题描述
我发现 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# 中可调整大小的表格布局面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:c# 中可调整大小的表格布局面板


- 如何用自己压缩一个 IEnumerable 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04