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


Python Button.Height方法代码示例

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


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

示例1: __init__

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

示例2: Form

# 需要导入模块: from System.Windows.Forms import Button [as 别名]
# 或者: from System.Windows.Forms.Button import Height [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.Height方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。