TableLayoutPanel 的 Control Columns 属性 [英] TableLayoutPanel's Control Columns properties

查看:47
本文介绍了TableLayoutPanel 的 Control Columns 属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我注意到添加到 TableLayoutPanel 的每个控件都被赋予了列"和行"属性.如何通过代码访问这些属性?
谢谢:)


I've noticed that every control added to the TableLayoutPanel is given "Column" and "Row" properties. How can I get access to these properties through code?
thanks:)

推荐答案

这些属性只存在于属性窗口中,由 IExtenderProvider 接口提供.它们在运行时不存在.扩展属性是:

These properties only exist in the Properties Window, magic provided by the IExtenderProvider interface. They don't exist at runtime. Extended properties are:

  • 列跨度.运行时:GetColumnSpan() 和 SetColumnSpan()
  • 行跨度.运行时:GetRowSpan() 和 SetRowSpan()
  • 行.运行时:GetRow() 和 SetRow()
  • 细胞.运行时:GetCellPosition() 和 SetCellPosition()
  • 列.运行时:GetColumn() 和 SetColumn()

显然,TLP 经过高度优化,可供设计人员使用.运行时有点痛苦.

Obviously TLP was highly optimized to be used from the designer. It's kinda of a pain at runtime.

这篇关于TableLayoutPanel 的 Control Columns 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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