本文整理汇总了Python中System.Windows.Forms.Button.Text方法的典型用法代码示例。如果您正苦于以下问题:Python Button.Text方法的具体用法?Python Button.Text怎么用?Python Button.Text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Button
的用法示例。
在下文中一共展示了Button.Text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __init__(self):
self.Text = 'Buttons'
self.Size = Size(WIDTH, HEIGHT)
ok = Button()
PANEL_HEIGHT = ok.Height + PANEL_SPACE
panel = Panel()
panel.Height = PANEL_HEIGHT
panel.Dock = DockStyle.Bottom
panel.Parent = self
x = ok.Width * 2 + BUTTONS_SPACE
y = (PANEL_HEIGHT - ok.Height) / 2
ok.Text = "Ok"
ok.Parent = panel
ok.Location = Point(WIDTH-x, y)
ok.Anchor = AnchorStyles.Right
close = Button()
x = close.Width
close.Text = "Close"
close.Parent = panel
close.Location = Point(WIDTH-x-CLOSE_SPACE, y)
close.Anchor = AnchorStyles.Right
self.CenterToScreen()
示例2: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __init__(self):
self.Title="Timer"
self.timer1=Timer()
self.timer1.Interval=1000
self.timer1.Tick+=self.timer1_tick
label1=Label()
label1.AutoSize=True
label1.Location=Point(41,22)
label1.Text="00:00:00"
label1.Font=Font("MS UI Gothic",24.0,FontStyle.Regular)
self.label1=label1
self.Controls.Add(self.label1)
clientwidth=255
b1=Button()
b1.Location=Point((clientwidth-b1.Width*2)/3,68)
b1.Text="Click"
b1.Click+=self.start_Click
self.Controls.Add(b1)
b2=Button()
b2.Location=Point((clientwidth-b1.Width*2)*2/3+b1.Width,68)
b2.Text="Stop"
b2.Click+=self.stop_Click
self.Controls.Add(b2)
self.ClientSize=Size(clientwidth,103)
self.Text="Stop Watch"
self.StartPosition=FormStartPosition.CenterScreen
示例3: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [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()
示例4: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __init__(self):
self.Text = 'Directories'
self.Size = Size(400, 400)
self.tv = TreeView()
self.SuspendLayout()
self.tv.Parent = self
self.tv.Location = Point(10,10)
self.tv.Size = Size(self.ClientSize.Width - 20, self.Height - 200)
self.tv.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right
self.tv.FullRowSelect = False
self.tv.ShowLines = True
self.tv.ShowPlusMinus = True
self.tv.Scrollable = True
self.tv.AfterSelect += self.AfterSelect
expand = Button()
expand.Parent = self
expand.Location = Point(20, self.tv.Bottom + 20)
expand.Text = 'Expand'
expand.Anchor = AnchorStyles.Left | AnchorStyles.Top
expand.Click += self.OnExpand
expandAll = Button()
expandAll.Parent = self
expandAll.Location = Point(20, expand.Bottom + 5)
expandAll.Text = 'Expand All'
expandAll.Anchor = AnchorStyles.Left | AnchorStyles.Top
expandAll.Click += self.OnExpandAll
collapse = Button()
collapse.Parent = self
collapse.Location = Point(expandAll.Right + 5, expand.Top)
collapse.Text = 'Collapse'
collapse.Anchor = AnchorStyles.Left | AnchorStyles.Top
collapse.Click += self.OnCollapse
collapseAll = Button()
collapseAll.Parent = self
collapseAll.Location = Point(collapse.Left, collapse.Bottom + 5)
collapseAll.Text = 'Collapse All'
collapseAll.Anchor = AnchorStyles.Left | AnchorStyles.Top
collapseAll.Click += self.OnCollapseAll
self.sb = StatusBar()
self.sb.Parent = self
self.ShowDirectories(self.tv.Nodes, HOME_DIR)
self.ResumeLayout()
self.CenterToScreen()
示例5: showBox
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [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...')
示例6: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __init__(self):
self.Text = 'Anchor'
self.Size = Size(210, 210)
btn1 = Button()
btn1.Text = "Button"
btn1.Parent = self
btn1.Location = Point(30, 30)
btn2 = Button()
btn2.Text = "Button"
btn2.Parent = self
btn2.Location = Point(30, 80)
btn2.Anchor = AnchorStyles.Right
self.CenterToScreen()
示例7: __init__
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [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)
示例8: __build_skipbutton
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_skipbutton(self):
""" builds and returns the skip button for this form """
button = Button()
button.DialogResult = DialogResult.Ignore
button.Location = Point(318, 362) if self.__config.show_covers_b else Point(105, 362)
button.Size = Size(90, 24)
button.Text = i18n.get("IssueFormSkip")
return button
示例9: __build_cancel_button
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_cancel_button(self):
''' builds and returns the cancel button for this form '''
button = Button()
button.DialogResult = DialogResult.Cancel
button.Location = Point(315, 343)
button.Size = Size(90, 23)
button.Text = i18n.get("ConfigFormCancel")
return button
示例10: __build_okbutton
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_okbutton(self):
''' builds and returns the ok button for this form '''
button = Button()
button.DialogResult = DialogResult.OK
button.Location = Point(15, 362)
button.Size = Size(90, 24)
button.Text = i18n.get("SeriesFormOK")
return button
示例11: __build_backbutton
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_backbutton(self):
""" builds and returns the back button for this form """
button = Button()
button.DialogResult = DialogResult.Retry
button.Location = Point(595, 362)
button.Size = Size(125, 24)
button.Text = i18n.get("IssueFormGoBack")
return button
示例12: __build_okbutton
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_okbutton(self):
''' builds and returns the ok button for this form '''
button = Button()
button.DialogResult = DialogResult.OK
button.Location = Point(228, 343)
button.Size = Size(80, 23)
button.Text = i18n.get("ConfigFormOK")
return button
示例13: __build_skipbutton
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_skipbutton(self):
''' builds and return the skip button for this form '''
button = Button()
button.DialogResult = DialogResult.Ignore
button.Location = Point(110, 362)
button.Size = Size(90, 24)
button.Text = i18n.get("SeriesFormSkip")
return button
示例14: __build_restore_button
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_restore_button(self):
''' builds and returns the restore button for this form '''
button = Button()
button.Click += self.__fired_restore_defaults
button.Location = Point(10, 343)
button.Size = Size(170, 23)
button.Text = i18n.get("ConfigFormRestore")
return button
示例15: __build_okbutton
# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Text [as 别名]
def __build_okbutton(self):
""" builds and returns the ok button for this form """
button = Button()
button.DialogResult = DialogResult.OK
button.Location = Point(223, 362) if self.__config.show_covers_b else Point(10, 362)
button.Size = Size(90, 24)
button.Text = i18n.get("IssueFormOK")
return button