我正在创建一个PanelControl,向其中添加一个简单的填充。但似乎不起作用。
请问如何做填充?
这是我的代码
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Panel As New DevExpress.XtraEditors.PanelControl
Dim Button As New DevExpress.XtraEditors.SimpleButton
Panel.Padding = New Padding(15)
Panel.Parent = Me
Button.Parent = Panel
End Sub
运行此代码时,面板内部创建的按钮与面板之间没有预期的空格。
谢谢
添加此额外的行可能会对您有所帮助。
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Panel As New DevExpress.XtraEditors.PanelControl
Dim Button As New DevExpress.XtraEditors.SimpleButton
Panel.AutoSize = True 'Adding this line should solve your problem
Panel.Padding = New Padding(15)
Panel.Parent = Me
Button.Parent = Panel
End Sub
请让我知道它是否适用于任何人...
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句