本文整理汇总了Python中System.Windows.Forms.Button.Height方法的典型用法代码示例。如果您正苦于以下问题:Python Button.Height方法的具体用法?Python Button.Height怎么用?Python Button.Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Button
的用法示例。
在下文中一共展示了Button.Height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Height [as 别名]
def __init__(self):
self.Text = "OpenDialog"
self.Height = 140
self.Width = 376
self.MinimizeBox = False
self.MaximizeBox = False
self.CenterToScreen()
self.label = Label()
self.label.Text = "you can type *.png or *.jpg to find your purpose file, we put *.png for your help"
self.label.Location = Point(0, 0)
self.label.Height = 30
self.label.Width = 380
button = Button()
button.Text = "Continue"
button.Location = Point(0, 30)
button.Height = 70
button.Width = 360
button.Click += self.buttonPressed
self.Controls.Add(self.label)
self.Controls.Add(button)
self.Show()
dialog = OpenFileDialog()
dialog.Filter = "PNG or BMP or Tif files(*.png,*.bmp,*.tif)|*.png;*.tif;*.bmp"
if dialog.ShowDialog(self) == DialogResult.OK:
#data = dialog.FileNames
f = open("Text/path.txt","w")
f.write(dialog.FileName + "\n")
f.close()
else:
f = open("Text/path.txt","w")
f.write("cancel\n")
f.close()
示例2: Form
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Height [as 别名]
from System.Windows.Forms import Form, Button, Application
from PythonSharp.Utilities import ObjectUtilities
f = Form()
f.Text = "PythonSharp Form"
b = Button()
b.Text = "Hello"
b.Width = 150
b.Height = 50
f.Controls.Add(b)
def click(sender, event):
print("Click")
ObjectUtilities.AddHandler(b, "Click", click, locals())
Application.Run(f)