PowerShell GUI之创建Button和输入框
来源:互联网 发布:残疾人产品设计 知乎 编辑:程序博客网 时间:2024/05/02 02:42
上一节学习了怎么创建一个form,更改颜色,字体背景什么的,这节课来学习如何添加button和输入框。
效果图如下:
代码原文:
Add-Type -AssemblyName System.Windows.FormsAdd-Type -AssemblyName System.Drawing$PowerShellForms = New-Object System.Windows.Forms.Form $PowerShellForms.Text = "The Second form"$PowerShellForms.Size = New-Object System.Drawing.Size(300,300) $PowerShellForms.StartPosition = "CenterScreen"$PowerShellForms.SizeGripStyle = "Hide"$OKButton = New-Object System.Windows.Forms.Button$OKButton.Location = New-Object System.Drawing.Point(75,160)$OKButton.Size = New-Object System.Drawing.Size(75,23)$OKButton.Text = "确定"$OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK$PowerShellForms.AcceptButton = $OKButton$PowerShellForms.Controls.Add($OKButton)$CancelButton = New-Object System.Windows.Forms.Button$CancelButton.Location = New-Object System.Drawing.Point(150,160)$CancelButton.Size = New-Object System.Drawing.Size(75,23)$CancelButton.Text = "Cancel"$CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel$PowerShellForms.CancelButton = $CancelButton$PowerShellForms.Controls.Add($CancelButton)$Labels1 = New-Object System.Windows.Forms.Label$Labels1.Location = New-Object System.Drawing.Point(10,20) $Labels1.Size = New-Object System.Drawing.Size(280,20) $Labels1.Text = "请输入你的名字:"$Labels1.AutoSize = $True$PowerShellForms.Controls.Add($Labels1) $Labels2 = New-Object System.Windows.Forms.Label$Labels2.Location = New-Object System.Drawing.Point(10,90) $Labels2.Size = New-Object System.Drawing.Size(280,20) $Labels2.Text = "请输入你的职位:"$Labels2.AutoSize = $True$PowerShellForms.Controls.Add($Labels2)$TextBox1 = New-Object System.Windows.Forms.TextBox $TextBox1.Location = New-Object System.Drawing.Point(10,50) $TextBox1.Size = New-Object System.Drawing.Size(260,20) $PowerShellForms.Controls.Add($TextBox1) $TextBox2 = New-Object System.Windows.Forms.TextBox $TextBox2.Location = New-Object System.Drawing.Point(10,120) $TextBox2.Size = New-Object System.Drawing.Size(260,20) $PowerShellForms.Controls.Add($TextBox2)$PowerShellForms.Topmost = $True$result = $PowerShellForms.ShowDialog()
0 0
- PowerShell GUI之创建Button和输入框
- PowerShell GUI 之使用visual studio创建GUI (1)
- PowerShell GUI 之使用visual studio创建GUI (2)
- PowerShell GUI 之 添加列表选择框
- PowerShell GUI 之基础知识
- EZ Gui 创建Button
- Unity3D入门——GUI之Button和RepeatButton控件
- PowerShell GUI 之 如何快速查询
- android之创建button
- cocos2dx之创建Button
- GUI button
- OpenCV之highgui 模块. 高层GUI和媒体I/O: 为程序界面添加滑动条 OpenCV的视频输入和相似度测量 用OpenCV创建视频
- python中GUI,Label和Button案例
- Android 输入控制和Button
- PowerShell构造GUI程序
- 解决iOS输入框和button圆角问题
- iOS输入框和button圆角问题
- iOS之代码创建button
- EMC的一道数字编程编程题
- secureCRT sftp 使用
- ios9网络请求https适配
- POJ3580 SuperMemo(Splay的区间操作)
- standalone在XML里的作用
- PowerShell GUI之创建Button和输入框
- LeetCode 子 Climbing Stairs
- linux 时间同步
- 第12周—项目3(2)图的广度遍历
- poj-2140-Herd Sums- 数学规律-连续和为N的方案数
- LeetCode 062 Unique Paths
- Android .gitignore文件示例
- XCode中类似reveal功能
- 使用Chrome调试JavaScript的断点设置和调试技巧