C#窗体应用程序之 单选按钮与分组框 源代码
来源:互联网 发布:去视频马赛克软件 编辑:程序博客网 时间:2024/06/05 06:08
using System.Windows.Forms;
using System.Drawing;
using System;
namespace lx21
{
public partial class Form2 : Form
{
//private Label LSex;
// private Label LMarry;
private GroupBox gbSex;
private GroupBox gbMarry;
private RadioButton rbMan;
private RadioButton rbWomen;
private RadioButton rbMarried;
private RadioButton rbSignal;
private Button btnOK;
public Form2()
{
InitializeComponent();
}
private void InitializeComponent()
{
// this.LSex = new Label();
// this.LMarry = new Label();
this.gbSex = new GroupBox();
this.gbMarry = new GroupBox();
this.rbMan = new RadioButton();
this.rbMarried = new RadioButton();
this.rbSignal = new RadioButton();
this.rbWomen = new RadioButton();
this.btnOK = new Button();
//this.ClientSize = new System.Drawing.Size(350, 225);
this.ClientSize = new System.Drawing.Size(500,300);
this.Text = "99问答";
//this.LSex.Location = new Point(50, 50);
//this.LSex.Size = new Size(50,50);
//this.LSex.TabIndex = 0;
//this.LSex.Text = "* 性别";
this.gbSex.Location = new Point(50, 50);
this.gbSex.Size = new Size(150, 160);
this.gbSex.TabStop = false;
this.gbSex.Text = "* 性别";
//this.LMarry.Location = new Point(250, 50);
//this.LMarry.Size = new Size(50,50);
//this.LMarry.TabIndex = 1;
//this.LMarry.Text = "* 婚否";
this.gbMarry.Location = new Point(250, 50);
this.gbMarry.Size = new Size(150, 160);
this.gbMarry.TabStop = false;
this.gbMarry.Text = "* 婚否";
this.rbMan.Location = new Point(50, 50);
this.rbMan.Size = new Size(50,50);
this.rbMan.TabIndex = 2;
this.rbMan.Text = "男";
this.rbWomen.Location = new Point(50, 90);
this.rbWomen.Size = new Size(50, 50);
this.rbWomen.TabIndex = 3;
this.rbWomen.Text = "女";
this.rbSignal.Location = new Point(50, 50);
this.rbSignal.Size = new Size(50, 50);
this.rbSignal.TabIndex = 4;
this.rbSignal.Text = "未婚";
this.rbMarried.Location = new Point(50, 90);
this.rbMarried.Size = new Size(50, 50);
this.rbMarried.TabIndex = 5;
this.rbMarried.Text = "已婚";
this.btnOK.Location = new Point(200, 249);
this.btnOK.Size = new Size(50,25);
this.btnOK.TabIndex = 6;
this.btnOK.Text = "提交";
this.btnOK.Click += new EventHandler(this.btnOK_Click);
//this.Controls.Add(LSex);
//this.Controls.Add(LMarry);
this.Controls.Add(gbSex);
this.Controls.Add(gbMarry);
//this.Controls.Add(rbMan);
//this.Controls.Add(rbWomen);
//this.Controls.Add(rbMarried);
//this.Controls.Add(rbSignal);
this.gbSex.Controls.Add(rbMan);
this.gbSex.Controls.Add(rbWomen);
this.gbMarry.Controls.Add(rbMarried);
this.gbMarry.Controls.Add(rbSignal);
this.Controls.Add(btnOK);
}
private void btnOK_Click(object sender, EventArgs e)
{
Application.Exit();
}
static void Main()
{
Application.Run(new Form2());
}
}
}
using System.Drawing;
using System;
namespace lx21
{
public partial class Form2 : Form
{
//private Label LSex;
// private Label LMarry;
private GroupBox gbSex;
private GroupBox gbMarry;
private RadioButton rbMan;
private RadioButton rbWomen;
private RadioButton rbMarried;
private RadioButton rbSignal;
private Button btnOK;
public Form2()
{
InitializeComponent();
}
private void InitializeComponent()
{
// this.LSex = new Label();
// this.LMarry = new Label();
this.gbSex = new GroupBox();
this.gbMarry = new GroupBox();
this.rbMan = new RadioButton();
this.rbMarried = new RadioButton();
this.rbSignal = new RadioButton();
this.rbWomen = new RadioButton();
this.btnOK = new Button();
//this.ClientSize = new System.Drawing.Size(350, 225);
this.ClientSize = new System.Drawing.Size(500,300);
this.Text = "99问答";
//this.LSex.Location = new Point(50, 50);
//this.LSex.Size = new Size(50,50);
//this.LSex.TabIndex = 0;
//this.LSex.Text = "* 性别";
this.gbSex.Location = new Point(50, 50);
this.gbSex.Size = new Size(150, 160);
this.gbSex.TabStop = false;
this.gbSex.Text = "* 性别";
//this.LMarry.Location = new Point(250, 50);
//this.LMarry.Size = new Size(50,50);
//this.LMarry.TabIndex = 1;
//this.LMarry.Text = "* 婚否";
this.gbMarry.Location = new Point(250, 50);
this.gbMarry.Size = new Size(150, 160);
this.gbMarry.TabStop = false;
this.gbMarry.Text = "* 婚否";
this.rbMan.Location = new Point(50, 50);
this.rbMan.Size = new Size(50,50);
this.rbMan.TabIndex = 2;
this.rbMan.Text = "男";
this.rbWomen.Location = new Point(50, 90);
this.rbWomen.Size = new Size(50, 50);
this.rbWomen.TabIndex = 3;
this.rbWomen.Text = "女";
this.rbSignal.Location = new Point(50, 50);
this.rbSignal.Size = new Size(50, 50);
this.rbSignal.TabIndex = 4;
this.rbSignal.Text = "未婚";
this.rbMarried.Location = new Point(50, 90);
this.rbMarried.Size = new Size(50, 50);
this.rbMarried.TabIndex = 5;
this.rbMarried.Text = "已婚";
this.btnOK.Location = new Point(200, 249);
this.btnOK.Size = new Size(50,25);
this.btnOK.TabIndex = 6;
this.btnOK.Text = "提交";
this.btnOK.Click += new EventHandler(this.btnOK_Click);
//this.Controls.Add(LSex);
//this.Controls.Add(LMarry);
this.Controls.Add(gbSex);
this.Controls.Add(gbMarry);
//this.Controls.Add(rbMan);
//this.Controls.Add(rbWomen);
//this.Controls.Add(rbMarried);
//this.Controls.Add(rbSignal);
this.gbSex.Controls.Add(rbMan);
this.gbSex.Controls.Add(rbWomen);
this.gbMarry.Controls.Add(rbMarried);
this.gbMarry.Controls.Add(rbSignal);
this.Controls.Add(btnOK);
}
private void btnOK_Click(object sender, EventArgs e)
{
Application.Exit();
}
static void Main()
{
Application.Run(new Form2());
}
}
}
0 0
- C#窗体应用程序之 单选按钮与分组框 源代码
- C# 窗体应用程序 之 单选按钮的实现 源代码
- 单选按钮分组
- 窗体实验之单选按钮
- 【C#之控制台与窗体应用程序】
- MFC问题集之单选按钮进行分组
- C#窗体应用(复选框,单选按钮,拖动水平滚动条)
- C#界面设计之复选按钮与单选按钮的使用实例
- C#控制台与窗体应用程序
- Windows单选按钮、复选框、分组框控件
- C# 选项、单选、多选、分组、MDI窗体的设计、PictureBox
- C# 单选按钮
- MFC单选按钮的分组问题
- datagrid groupview分组新增单选按钮
- C# 串口与窗体应用程序的连接
- C#窗体应用程序之碰撞检测
- C#窗体应用程序之随机数生成
- C#窗体应用程序之Paint事件
- JSF生命周期总结
- 《凑硬币》 动态规划算法入门
- CSS技巧荟萃:了解CSS页面布局和加载流程
- 视频监控知识
- 用Python处理Cookie - Python开发技术文章
- C#窗体应用程序之 单选按钮与分组框 源代码
- POJ 3616-Milking Time (基础DP)
- WebSocket
- 27 岁后月薪低于 8K,会被淘汰吗?
- POJ - 1860 URAL - 1162 Currency Exchange
- Android Soundpool学习
- Block的用法
- C/C++语言指针使用总结
- node-schedule的使用