[英]VB.NET UserControl inherits from AutoScaleDimensions
我刚刚添加了
Public Class ucGrid : Inherits System.Windows.Forms.Control
至
Public Class ucGrid
然后在以下两行出现错误:
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
我得到的错误是“ .AutoScaleDimnension”不是uGridGrid的成员”和“ AutoScaleMode不是uGrid的成员”
有人可以告诉我这是怎么回事吗? 我想我缺少扩展程序,但我真的不知道在哪里/如何解决此问题。
谢谢!
AutoScaleMode
是Forms的成员, AutoScaleDimensions
是Container控件的成员。 当您使用的是UserControl
(从名称ucGrid
猜测)时,它是Forms
的成员并继承自ContainerControl
因此这两个属性均可用。
现在,由于您继承自System.Windows.Forms.Control
(继承自Component
),因此这些属性不存在。 从技术上讲, ucGrid
不再是UserControl,而是控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.