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


Python Button.BackColor方法代码示例

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


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

示例1: __init__

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import BackColor [as 别名]
    def __init__(self):
        # main form attributes
        self.Text = 'ff2delim'
        self.BackColor = Color.LightSlateGray
        self.ForeColor = Color.White
        self.BorderStyle = BorderStyle.Fixed3D
        self.count = 0
        self.Width = 800
        self.Height = 400

#------------------------------------------------------------
        # labels
#------------------------------------------------------------
        # main description
        self.label = Label()
        self.label.Text = "Convert fixed legnth file to delimited"
        self.label.Location = Point(50, 25)
        self.label.Height = 30
        self.label.Width = 600

        # error / compleation messages
        self.label_submit = Label()
        self.label_submit.Text = ""
        self.label_submit.Location = Point(140, 305)
        self.label_submit.Height = 30
        self.label_submit.Width = 600 

        # filename label
        self.label_filename = Label()
        self.label_filename.Text = ""
        self.label_filename.Location = Point(140, 105)
        self.label_filename.Height = 30
        self.label_filename.Width = 600    
        
        #layout label
        self.label_layout = Label()
        self.label_layout.Text = ""
        self.label_layout.Location = Point(140, 135)
        self.label_layout.Height = 30
        self.label_layout.Width = 600    
#------------------------------------------------------------
        # buttons
#------------------------------------------------------------
        # filename button
        button = Button()
        button.Text = "File name"
        button.BackColor = Color.DimGray
        button.Location = Point(50, 100)
        button.Click += self.buttonPressed
        
        # layout button
        button2 = Button()
        button2.Text = "Layout"
        button2.BackColor = Color.DimGray
        button2.Location = Point(50, 130)
        button2.Click += self.button2Pressed
        
        # submit button
        button_submit = Button()
        button_submit.Text = "Convert"
        button_submit.BackColor = Color.DimGray
        button_submit.Location = Point(50, 300)
        button_submit.Click += self.button_submitPressed
        
# -----------------------------------------------------------
        # header yes or no radio buttons
#------------------------------------------------------------
        self.radioLabel2 = Label()
        self.radioLabel2.Text = "Field names in layout"
        self.radioLabel2.ForeColor = Color.White
        self.radioLabel2.Location = Point(50, 160)
        self.radioLabel2.Height = 15
        self.radioLabel2.Width = 600

        self.headerTrue = RadioButton()
        self.headerTrue.Text = "Yes"
        self.headerTrue.Location = Point(55, 175)
        self.headerTrue.Width = 50            
        self.headerTrue.Height = 15            
        self.headerTrue.CheckedChanged += self.HeaderCheckedChanged

        self.headerFalse = RadioButton()
        self.headerFalse.Text = "No"
        self.headerFalse.Location = Point(105, 175)
        self.headerFalse.Width = 50            
        self.headerFalse.Height = 15            
        self.headerFalse.CheckedChanged += self.HeaderCheckedChanged
        
        self.headerDefault = Label()
        self.headerDefault.Text = "(Defaults to yes)"
        self.headerDefault.ForeColor = Color.DarkSlateBlue
        self.headerDefault.Location = Point(50, 195)
        self.headerDefault.Height = 15
        self.headerDefault.Width = 600

#---------------------------------------------------------------
        # delimiter radio buttons
#---------------------------------------------------------------
        self.radioLabel1 = Label()
        self.radioLabel1.Text = "Delimiter"
#.........这里部分代码省略.........
开发者ID:casssax,项目名称:ff2delim_gui,代码行数:103,代码来源:widg2.1.py


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