當前位置: 首頁>>代碼示例>>Python>>正文


Python Button.Width方法代碼示例

本文整理匯總了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()
開發者ID:PMoureu,項目名稱:samples-Python-RPS,代碼行數:36,代碼來源:layers.py

示例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)
開發者ID:ekmmetering,項目名稱:ekmmeters,代碼行數:27,代碼來源:simple_winform.py

示例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...')
開發者ID:PMoureu,項目名稱:samples-Python-RPS,代碼行數:53,代碼來源:userform.py

示例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)
開發者ID:rachmatg,項目名稱:ironpython,代碼行數:25,代碼來源:renamedialog.py

示例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()                
開發者ID:tornado80,項目名稱:Pack,代碼行數:44,代碼來源:Test01.py

示例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)
開發者ID:Refandler,項目名稱:PythonSharp,代碼行數:21,代碼來源:form.py


注:本文中的System.Windows.Forms.Button.Width方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。