本文整理汇总了Python中System.Windows.Forms.Button.Width方法的典型用法代码示例。如果您正苦于以下问题:Python Button.Width方法的具体用法?Python Button.Width怎么用?Python Button.Width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Button
的用法示例。
在下文中一共展示了Button.Width方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Width [as 别名]
def __init__(self, itemlist):
height = len(itemlist)*17
self.Text = "Select the categories to export"
self.Size = Size(300, height + 80)
self.check = CheckedListBox()
self.check.Parent = self
self.check.Location = Point(5, 5)
self.check.Size = Size(270, height)
# load the list of relevant categories found in the project
list_items = List[Object](itemlist)
self.check.Items.AddRange(list_items.ToArray())
self.check.CheckOnClick = True
# set checked by default
for i in range(len(itemlist)):
self.check.SetItemChecked(i , True)
okay = Button()
okay.Parent = self
okay.Text = 'OK'
okay.Location = Point(50, height+10)
okay.Width = 140
okay.Click += self.onValidate
cancel = Button()
cancel.Parent = self
cancel.Text = 'Cancel'
cancel.Location = Point(okay.Right, height+10)
cancel.Click += self.onCancel
self.CenterToScreen()
示例2: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Width [as 别名]
def __init__(self):
self.m_testport = 'COM3' #: Port on test system
self.m_test_meter = "300001162" #: Test V4 meter
ekm_set_log(ekm_print_log)
print "\n****\nInitializing v3 and v4 for db test"
self.Text = 'Sample EKM Iron Python App'
self.label = Label()
self.label.Text = "0.0"
self.label.Location = Point(50, 50)
self.label.Height = 30
self.label.Width = 200
self.count = 0
button = Button()
button.Text = "Read Meter: " + self.m_test_meter
button.Location = Point(50, 100)
button.Width = 180
button.Click += self.buttonPressed
self.Controls.Add(self.label)
self.Controls.Add(button)
示例3: showBox
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Width [as 别名]
def showBox(self):
'''
set the remaining box controls and launch
'''
self.buttonpanel = Panel()
self.buttonpanel.Parent = self
self.buttonpanel.Location = Point(0,self.panel.Bottom)
self.buttonpanel.Size = Size(Fconfig.smwidth, 2* Fconfig.unitline)
self.buttonpanel.Dock = DockStyle.Bottom
self.warning = Label()
self.warning.Parent = self.buttonpanel
self.warning.Location = Point(Fconfig.margin, 0)
self.warning.Size = Size(Fconfig.smwidth, Fconfig.unitline)
self.warning.Font = Font(Fconfig.basefont, Fconfig.sizefont, FontStyle.Bold)
self.warning.ForeColor = Color.Coral
self.warning.TextAlign = ContentAlignment.MiddleCenter
okay = Button()
okay.Parent = self.buttonpanel
okay.Text = Fconfig.buttonOK
okay.Location = Point(50, Fconfig.unitline)
okay.Width = 140
okay.Click += self.onValidate
okay.Anchor = AnchorStyles.Right
cancel = Button()
cancel.Text = Fconfig.buttonCANCEL
cancel.Parent = self.buttonpanel
cancel.Location = Point(okay.Right, Fconfig.unitline)
cancel.Click += self.onCancel
cancel.Anchor = AnchorStyles.Right
self.Width = Fconfig.width
self.Height = self.panel.Bottom + 105
self.CenterToScreen()
ModeDBG.say('\npanel top :{0}, bottom :{1}'.format(
self.panel.Top, self.panel.Bottom))
ModeDBG.say('\n\nPanel loaded with {0} items\n'.format(
len(self.panelparams)))
# Display the form
try:
if Application.MessageLoop:
TaskDialog.Show('UserForm', 'Another window is running...')
else:
Application.Run(self)
except:
TaskDialog.Show('UserForm','Loading failed...')
示例4: initialiseButtons
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Width [as 别名]
def initialiseButtons(self):
buttonPanel = Panel()
buttonPanel.Height = 23
buttonPanel.Dock = DockStyle.Bottom
buttonPanel.Width = 170
acceptButton = Button()
acceptButton.Text = "OK"
acceptButton.DialogResult = DialogResult.OK
acceptButton.Width = 75
acceptButton.Dock = DockStyle.Left
self.AcceptButton = acceptButton
buttonPanel.Controls.Add(acceptButton)
cancelButton = Button()
cancelButton.Text = "Cancel"
cancelButton.DialogResult = DialogResult.Cancel
cancelButton.Width = 75
cancelButton.Dock = DockStyle.Right
self.CancelButton = cancelButton
buttonPanel.Controls.Add(cancelButton)
self.Controls.Add(buttonPanel)
示例5: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Width [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()
示例6: Form
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Width [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)