当前位置: 首页>>代码示例>>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;未经允许,请勿转载。