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


Python Button.Dock方法代碼示例

本文整理匯總了Python中System.Windows.Forms.Button.Dock方法的典型用法代碼示例。如果您正苦於以下問題:Python Button.Dock方法的具體用法?Python Button.Dock怎麽用?Python Button.Dock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.Button的用法示例。


在下文中一共展示了Button.Dock方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from System.Windows.Forms import Button [as 別名]
# 或者: from System.Windows.Forms.Button import Dock [as 別名]
 def __init__(self, watcher=None):
     #
     self.__watcher = watcher
     self.Text = "FileWatcher configuration"
     self.__table = TableLayoutPanel()
     self.MinimumSize = Size(520, 360)
     self.Size = Size(640, 360)
     self.MaximizeBox = False
     self.Icon = Icon("watcher.ico")
     p = Panel()
     p.Padding = Padding(10, 0, 10, 10)
     exitBut = Button(Text="E&xit")
     p.Height = exitBut.Height + 10
     p.Controls.Add(exitBut)
     exitBut.Dock = DockStyle.Right
     p.Dock = DockStyle.Bottom
     def exit(s, e):
         self.Dispose()
     exitBut.Click += exit
     self.Controls.Add(p)
     self.Controls.Add(self.__table)
     label = Label(Text="Watch Directories")
     self.__table.Controls.Add(label)
     self.__list = ListBox()
     self.__list.Width = 500
     self.__table.Dock = DockStyle.Fill
     try:
         for wd in watcher.controller.watchDirectories.itervalues():
             self.__list.Items.Add(wd)
     except Exception, e:
         self.__list.Items.Add(str(e))
開發者ID:kiranba,項目名稱:the-fascinator,代碼行數:33,代碼來源:configForm.py

示例2: initialiseButtons

# 需要導入模塊: from System.Windows.Forms import Button [as 別名]
# 或者: from System.Windows.Forms.Button import Dock [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

示例3: InkOverlay

# 需要導入模塊: from System.Windows.Forms import Button [as 別名]
# 或者: from System.Windows.Forms.Button import Dock [as 別名]
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):
    overlay.Ink.DeleteStrokes()
    pnl.Refresh()
開發者ID:rubychilds,項目名稱:SudukoSolver,代碼行數:33,代碼來源:handwritingRec.py


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