当前位置: 首页>>代码示例>>Python>>正文


Python Button.Parent方法代码示例

本文整理汇总了Python中System.Windows.Forms.Button.Parent方法的典型用法代码示例。如果您正苦于以下问题:Python Button.Parent方法的具体用法?Python Button.Parent怎么用?Python Button.Parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Button的用法示例。


在下文中一共展示了Button.Parent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [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 Parent [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()    
开发者ID:DaiHanpeng,项目名称:IronPython-WinForm-Testing,代码行数:35,代码来源:007_Anchored_Button.py

示例3: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [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()
开发者ID:DaiHanpeng,项目名称:IronPython-WinForm-Testing,代码行数:58,代码来源:025_directories.py

示例4: showBox

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [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

示例5: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [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()
开发者ID:DaiHanpeng,项目名称:IronPython-WinForm-Testing,代码行数:18,代码来源:005_Anchor.py

示例6: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [as 别名]
 def __init__(self):
     self.Text = "Button"
     self.CenterToScreen()
     self.Size = Size(200, 150)
     
     btn = Button()
     btn.Parent = self
     btn.Text = "Quit"
     btn.Location = Point(50, 50)
     btn.Click += self.OnClick
     btn.MouseEnter += self.OnEnter
开发者ID:GikonyoB,项目名称:Tutorials,代码行数:13,代码来源:button.py

示例7: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [as 别名]
    def __init__(self):
        self.Text = 'Drag & Drop'

        button = Button()
        button.Parent = self
        button.Text = 'Button'
        button.MouseDown += self.OnMousDown
        button.MouseUp += self.OnMousUp
        button.MouseMove += self.OnMousMove

        button.Location = Point(20, 20)

        self.isDragging = False
        self.CenterToScreen()
开发者ID:DaiHanpeng,项目名称:IronPython-WinForm-Testing,代码行数:16,代码来源:029_DragButton.py

示例8: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [as 别名]
    def __init__(self):
        self.Text = "Tooltips"
        self.CenterToScreen()
        self.Size = Size(200, 150)

        tooltip = ToolTip()
        tooltip.SetToolTip(self, "This is a Form")

        button = Button()
        button.Parent = self
        button.Text = "Button"
        button.Location = Point(50, 70)

        tooltip.SetToolTip(button, "This is a Button")
开发者ID:enforcers22,项目名称:Tutorials,代码行数:16,代码来源:tooltips.py

示例9: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [as 别名]
    def __init__(self):
        self.Text = 'Tooltips'
        self.CenterToScreen()
        xsize,ysize=300,200
        self.Size = Size(xsize, ysize)

        tooltip = ToolTip()
        tooltip.SetToolTip(self, "This is a Form")

        button = Button()
        button.Parent = self
        button.Text = "Button"
        xloc,yloc=50,70
        button.Location = Point(xloc,yloc)

        tooltip.SetToolTip(button, "This is a Button")
开发者ID:terasakisatoshi,项目名称:PythonCode,代码行数:18,代码来源:tooltips.py

示例10: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [as 别名]
    def __init__(self):
        self.Text = 'Drag & Drop'
        self.AllowDrop = True

        button = Button()
        button.Parent = self
        textBox = TextBox()
        textBox.Parent = self
 
        button.AllowDrop = True
        button.Location = Point(150, 50)
        button.DragDrop += self.OnDragDrop
        button.DragEnter += self.OnDragEnter

        textBox.Location = Point(15, 50)
        textBox.MouseDown += self.OnMousDown

        self.ClientSize = Size(250, 200)
        self.CenterToScreen()
开发者ID:DaiHanpeng,项目名称:IronPython-WinForm-Testing,代码行数:21,代码来源:030_DragText.py

示例11: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Parent [as 别名]
    def __init__(self):

        self.Text = 'Player'        
        self.Size = Size(350, 280)

        mainMenu = MainMenu()
        filem = mainMenu.MenuItems.Add("&File")
        playm = mainMenu.MenuItems.Add("&Play")
        view = mainMenu.MenuItems.Add("&View")

        tools = mainMenu.MenuItems.Add("&Tools")
        favourites = mainMenu.MenuItems.Add("&Favourites")
        help = mainMenu.MenuItems.Add("&Help")
        filem.MenuItems.Add(MenuItem("E&xit",
                 self.OnExit, Shortcut.CtrlX))

        self.Menu = mainMenu

        panel = Panel()
        panel.Parent = self
        panel.BackColor = Color.Black
        panel.Dock = DockStyle.Fill
       
        buttonPanel = Panel()
        buttonPanel.Parent = self
        buttonPanel.Height = 40
        buttonPanel.Dock = DockStyle.Bottom

        pause = Button()
        pause.FlatStyle = FlatStyle.Popup
        pause.Parent = buttonPanel
        pause.Location = Point(5, 10)
        pause.Size = Size(25, 25)
        pause.Image = Bitmap("pause.png")

        play = Button()
        play.FlatStyle = FlatStyle.Popup
        play.Parent = buttonPanel
        play.Location = Point(35, 10)
        play.Size = Size(25, 25)
        play.Image = Bitmap("play.png")

        forward = Button()
        forward.FlatStyle = FlatStyle.Popup
        forward.Parent = buttonPanel
        forward.Location = Point(80, 10)
        forward.Size = Size(25, 25)
        forward.Image = Bitmap("forward.png")

        backward = Button()
        backward.FlatStyle = FlatStyle.Popup
        backward.Parent = buttonPanel
        backward.Location = Point(110, 10)
        backward.Size = Size(25, 25)
        backward.Image = Bitmap("backward.png")

        tb = TrackBar()
        tb.Parent = buttonPanel
        tb.TickStyle = TickStyle.None
        tb.Size = Size(150, 25)
        tb.Location = Point(200, 10)
        tb.Anchor = AnchorStyles.Right

        audio = Button()
        audio.FlatStyle = FlatStyle.Popup
        audio.Parent = buttonPanel
        audio.Size = Size(25, 25)
        audio.Image = Bitmap("audio.png")
        audio.Location = Point(170, 10)
        audio.Anchor = AnchorStyles.Right

        sb = StatusBar()
        sb.Parent = self
        sb.Text = "Ready"

        self.CenterToScreen()
开发者ID:DaiHanpeng,项目名称:IronPython-WinForm-Testing,代码行数:78,代码来源:008_Music_Player.py


注:本文中的System.Windows.Forms.Button.Parent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。