本文整理汇总了Python中System.Windows.Forms.Form.Height方法的典型用法代码示例。如果您正苦于以下问题:Python Form.Height方法的具体用法?Python Form.Height怎么用?Python Form.Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.Height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: import
# 需要导入模块: from System.Windows.Forms import Form [as 别名]
# 或者: from System.Windows.Forms.Form import Height [as 别名]
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Windows.Forms import (
Application, Form,
FormBorderStyle, Label
)
from System.Drawing import (
Color, Font, FontStyle, Point
)
form = Form()
form.Text = "Hello World"
form.FormBorderStyle = FormBorderStyle.Fixed3D
form.Height = 150
newFont = Font("Verdana", 16,
FontStyle.Bold | FontStyle.Italic)
label = Label()
label.AutoSize = True
label.Text = "My Hello World Label"
label.Font = newFont
label.BackColor = Color.Aquamarine
label.ForeColor = Color.DarkMagenta
label.Location = Point(10, 50)
form.Controls.Add(label)
Application.Run(form)
示例2: Panel
# 需要导入模块: from System.Windows.Forms import Form [as 别名]
# 或者: from System.Windows.Forms.Form import Height [as 别名]
pnl = Panel()
pnl.BackColor = Color.Khaki
overlay = InkOverlay(pnl)
overlay.Enabled = True
tb = TextBox()
tb.Font = Font('serif', 20)
tb.Multiline = True
sc = SplitContainer()
sc.SplitterWidth = 10
sc.Orientation = Orientation.Horizontal
# Layout
f.Width = 600
f.Height = 400
sc.Dock = DockStyle.Fill
btn.Dock = DockStyle.Top
tb.Dock = DockStyle.Fill
pnl.Dock = DockStyle.Fill
f.Controls.Add(sc)
sc.Panel1.Controls.Add(btn)
sc.Panel1.Controls.Add(pnl)
sc.Panel2.Controls.Add(tb)
# Event handling
def OnStroke(sender, args):
tb.Text = overlay.Ink.Strokes.ToString()
overlay.Stroke += OnStroke
def OnClick(sender, args):