Frm_Main.cs

View Code
  1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using System.Data.SqlClient;
10
11 namespace RefreshFormByChildForm
12 {
13 public partial class Frm_Main : Form
14 {
15 public Frm_Main()
16 {
17 InitializeComponent();
18 }
19 /// <summary>
20 /// 本实例应该设置主窗体的IsMdiContainer属性为true、MainMenuStrip属性为所添加的菜单栏、WindowState属性为Maximized、窗体名称为FrmMain、设置AllowUserToAddRows属性为false
21 /// </summary>
22
23 #region 声明的变量
24 public static bool flag=false ;//标识是否创建新的子窗体
25 Frm_Child BabyWindow = new Frm_Child();//实例化一个子窗体
26 DataSet PubsSet = new DataSet(); //定义一个数据集对象
27 public static string[] IDArray; //声明一个一维字符串数组
28 public DataTable IDTable; //声明一个数据表对象
29 SqlDataAdapter IDAdapter; //声明一个数据读取器对象
30 SqlDataAdapter PubsAdapter; //声明一个数据读取器对象
31 SqlConnection ConnPubs; //声明一个数据库连接对象
32 SqlCommand PersonalInformation; //声明一个执行SQL语句的对象
33 #endregion
34
35 private void Frm_Main_Load(object sender,EventArgs e)
36 {
37 string ConnString = "Data Source=WRET-MOSY688YVW\\MRGLL;DataBase=db_TomeOne;UID=sa;Pwd=;";//数据库连接字符串
38 string AdapterString = "select userID as 编号,userName as 姓名 ,phone as 电话,address as 住址 from tb_User";//用于查询的字符串
39 string IDString = "select userID from tb_User";//读取数据库中用户的ID编号字符串
40 ConnPubs = new SqlConnection(ConnString);//建立数据库连接
41 PubsAdapter = new SqlDataAdapter(AdapterString,ConnPubs);//创建PubsAdapter数据读取器
42 IDAdapter = new SqlDataAdapter(IDString,ConnPubs);//用于读取用户编号的读取器
43 PubsAdapter.Fill(PubsSet, "tb_User");//填充PubsSet数据集
44 IDAdapter.Fill(PubsSet,"ID");//填充PubsSet数据集
45 DataTable PubsTable = PubsSet.Tables["tb_User"];//将数据写入PubsTable表
46 IDTable = PubsSet.Tables["ID"];//将数据写入ID表
47 IDArray = new string[IDTable.Rows.Count];//为数组定义最大长度
48 dataGridView1.DataSource = PubsTable.DefaultView;//设置dataGridView1的数据源
49 for(int i = 0; i < IDTable.Rows.Count; i++) //循环遍历数据表中的每一行数据
50 {
51 for(int j = 0; j < IDTable.Columns.Count; j++)//循环遍历数据表中的每一列数据
52 {
53 IDArray[i] = IDTable.Rows[i][j].ToString(); //将数据表中的数据添加至一个一维数组
54 }
55 }
56 }
57
58 #region 增加单一的FrmChild窗体
59 private void AddandDelete_Click(object sender,EventArgs e)
60 {
61 if(flag == false)//判断标识的值决定是否创建窗体
62 {
63 CreateFrmChild();//创建子窗体
64 }
65 for(int i = 0; i < this.dataGridView1.Controls.Count; i++)//循环遍历DataGridView控件上的控件集
66 {
67 if(this.dataGridView1.Controls[i].Name.Equals(BabyWindow.Name))//当存在子窗体时
68 {
69 flag = true;//改变标识Flag的值
70 break;//退出循环体
71 }
72 }
73 }
74 #endregion
75
76 private void ExitProject_Click(object sender,EventArgs e)
77 {
78 Application.Exit();//退出本程序
79 }
80
81 #region 创建子窗体的CreateFrmChild方法
82 public void CreateFrmChild()
83 {
84 Frm_Child BabyWindow = new Frm_Child();//实例化一个子窗体
85 BabyWindow.MdiParent = this;//设置子窗体的父窗体为当前窗体
86 this.dataGridView1.Controls.Add(BabyWindow);//在DataGridView控件中添加子窗体
87 BabyWindow.UpdateDataGridView += new EventHandler(BabyWindow_UpdateDataGridView);
88 BabyWindow.Show();//显示子窗体
89 }
90
91 void BabyWindow_UpdateDataGridView(object sender,EventArgs e)
92 {
93 if(Frm_Child.GlobalFlag == false) //当单击删除按钮时
94 {
95 if(ConnPubs.State == ConnectionState.Closed) //当数据库处于断开状态时
96 {
97 ConnPubs.Open(); //打开数据库的连接
98 }
99 string AfreshString = "delete tb_User where userID=" + Frm_Child.DeleteID.Trim();//定义一个删除数据的字符串
100 PersonalInformation = new SqlCommand(AfreshString,ConnPubs); //执行删除数据库字段
101 PersonalInformation.ExecuteNonQuery(); //执行SQL语句并返回受影响的行数
102 ConnPubs.Close(); //关闭数据库
103 DisplayData(); //显示数据库更新后的内容
104 MessageBox.Show("数据删除成功!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);//弹出删除数据成功的提示
105 }
106 else
107 {
108 if(ConnPubs.State == ConnectionState.Closed) //当数据库处于关闭状态时
109 {
110 ConnPubs.Open(); //打开数据库
111 }
112 string InsertString = "insert into tb_User values('" + Frm_Child.idContent + "','" + Frm_Child.nameContent + "','" + Frm_Child.phoneContent + "','" + Frm_Child.addressContent + "')";//定义一个插入数据的字符串变量
113 PersonalInformation = new SqlCommand(InsertString,ConnPubs);//执行插入数据库字段
114 PersonalInformation.ExecuteNonQuery();//执行SQL语句并返回受影响的行数
115 ConnPubs.Close(); //关闭数据库
116 DisplayData(); //显示更新后的数据
117 MessageBox.Show("数据添加成功!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);//弹出添加成功的提示信息
118 }
119 }
120 #endregion
121
122 #region 用于读取数据库的DisplayData方法
123 public void DisplayData()
124 {
125 PubsSet.Clear();
126 string ConnString = "Data Source=WRET-MOSY688YVW\\MRGLL;DataBase=db_TomeOne;UID=sa;Pwd=;";//数据库连接字符串
127 ConnPubs = new SqlConnection(ConnString);//建立数据库连接
128 string DisplayString = "select userId as 编号,userName as 姓名 ,phone as 电话,address as 住址 from tb_User";//定义读取数据库的字段
129 SqlDataAdapter PersonalAdapter = new SqlDataAdapter(DisplayString,ConnPubs); //定义一个读取数据库数据的读取器
130 PersonalAdapter.Fill(PubsSet, "tb_User"); //向表DisplayTable中填充数据
131 dataGridView1.DataSource = PubsSet.Tables["tb_User"].DefaultView;//设定DataGridView控件的数据源
132 }
133 #endregion
134 }
135 }

Frm_Main.designer.cs

View Code
  1 namespace RefreshFormByChildForm
2 {
3 partial class Frm_Main
4 {
5 /// <summary>
6 /// 必需的设计器变量。
7 /// </summary>
8 private System.ComponentModel.IContainer components = null;
9
10 /// <summary>
11 /// 清理所有正在使用的资源。
12 /// </summary>
13 /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
14 protected override void Dispose(bool disposing)
15 {
16 if(disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }
22
23 #region Windows 窗体设计器生成的代码
24
25 /// <summary>
26 /// 设计器支持所需的方法 - 不要
27 /// 使用代码编辑器修改此方法的内容。
28 /// </summary>
29 private void InitializeComponent()
30 {
31 this.menuStrip1 = new System.Windows.Forms.MenuStrip();
32 this.OperateDataType = new System.Windows.Forms.ToolStripMenuItem();
33 this.AddandDelete = new System.Windows.Forms.ToolStripMenuItem();
34 this.ExitProject = new System.Windows.Forms.ToolStripMenuItem();
35 this.dataGridView1 = new System.Windows.Forms.DataGridView();
36 this.menuStrip1.SuspendLayout();
37 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
38 this.SuspendLayout();
39 //
40 // menuStrip1
41 //
42 this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
43 this.OperateDataType});
44 this.menuStrip1.Location = new System.Drawing.Point(0, 0);
45 this.menuStrip1.Name = "menuStrip1";
46 this.menuStrip1.Size = new System.Drawing.Size(292, 25);
47 this.menuStrip1.TabIndex = 1;
48 this.menuStrip1.Text = "menuStrip1";
49 //
50 // OperateDataType
51 //
52 this.OperateDataType.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
53 this.AddandDelete,
54 this.ExitProject});
55 this.OperateDataType.Name = "OperateDataType";
56 this.OperateDataType.Size = new System.Drawing.Size(68, 21);
57 this.OperateDataType.Text = "操作类型";
58 //
59 // AddandDelete
60 //
61 this.AddandDelete.Name = "AddandDelete";
62 this.AddandDelete.ShortcutKeyDisplayString = "";
63 this.AddandDelete.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.C)));
64 this.AddandDelete.Size = new System.Drawing.Size(176, 22);
65 this.AddandDelete.Text = "增加与删除";
66 this.AddandDelete.Click += new System.EventHandler(this.AddandDelete_Click);
67 //
68 // ExitProject
69 //
70 this.ExitProject.Name = "ExitProject";
71 this.ExitProject.ShortcutKeyDisplayString = "";
72 this.ExitProject.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.X)));
73 this.ExitProject.Size = new System.Drawing.Size(176, 22);
74 this.ExitProject.Text = "退出";
75 this.ExitProject.Click += new System.EventHandler(this.ExitProject_Click);
76 //
77 // dataGridView1
78 //
79 this.dataGridView1.AllowUserToAddRows = false;
80 this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
81 | System.Windows.Forms.AnchorStyles.Left)
82 | System.Windows.Forms.AnchorStyles.Right)));
83 this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ActiveCaption;
84 this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
85 this.dataGridView1.Location = new System.Drawing.Point(-2, 24);
86 this.dataGridView1.Name = "dataGridView1";
87 this.dataGridView1.RowTemplate.Height = 23;
88 this.dataGridView1.Size = new System.Drawing.Size(293, 243);
89 this.dataGridView1.TabIndex = 3;
90 //
91 // Frm_Main
92 //
93 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
94 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
95 this.ClientSize = new System.Drawing.Size(292, 266);
96 this.Controls.Add(this.dataGridView1);
97 this.Controls.Add(this.menuStrip1);
98 this.IsMdiContainer = true;
99 this.MainMenuStrip = this.menuStrip1;
100 this.Name = "Frm_Main";
101 this.Text = "通过子窗体刷新父窗体";
102 this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
103 this.Load += new System.EventHandler(this.Frm_Main_Load);
104 this.menuStrip1.ResumeLayout(false);
105 this.menuStrip1.PerformLayout();
106 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
107 this.ResumeLayout(false);
108 this.PerformLayout();
109
110 }
111
112 #endregion
113
114 private System.Windows.Forms.MenuStrip menuStrip1;
115 private System.Windows.Forms.ToolStripMenuItem OperateDataType;
116 private System.Windows.Forms.ToolStripMenuItem AddandDelete;
117 private System.Windows.Forms.ToolStripMenuItem ExitProject;
118 private System.Windows.Forms.DataGridView dataGridView1;
119 }
120 }

Frm_Child.cs

View Code
  1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9
10 namespace RefreshFormByChildForm
11 {
12 public partial class Frm_Child : Form
13 {
14 public Frm_Child()
15 {
16 InitializeComponent();
17 }
18 ///<summary>
19 /// 本实例仅可创建一个窗口,因此在这里屏蔽关闭按钮;最大化后没有实际意义,因此关闭MaximizeBox属性值为False
20 ///</summary>
21
22 #region 变量的声明
23 public event EventHandler UpdateDataGridView = null;//定义一个处理更新DataGridView控件内容的方法
24 public static string DeleteID; //定义一个表示删除数据编号的字符串
25 public static string idContent; //该变量用来存储数据编号
26 public static string nameContent;//该变量用来存储姓名
27 public static string phoneContent;//该变量用来存储电话
28 public static string addressContent;//该变量用来存储住址
29 public static bool GlobalFlag; //该变量用来标识是否创建新的子窗体
30 #endregion
31
32 protected void UpdateData()
33 {
34 if(UpdateDataGridView != null)//当触发更新DataGridView事件时
35 {
36 UpdateDataGridView(this,EventArgs.Empty);//更新DataGridView控件中的内容
37 }
38 }
39
40 private void Frm_Child_FormClosing(object sender,FormClosingEventArgs e)
41 {
42 Frm_Main.flag = false; //设定该值为false表示可以创建新窗体
43 }
44
45 private void Frm_Child_Load(object sender,EventArgs e)
46 {
47 for(int i = 0; i < Frm_Main.IDArray.Length; i++) //循环遍历数组中的每一个元素
48 {
49 comboBox1.Items.Add(Frm_Main.IDArray[i].ToString());//向Combobox控件中添加内容
50 comboBox1.SelectedIndex = 0;//设定当前选中项的索引为0
51 }
52 }
53
54 private void deleteButton_Click(object sender,EventArgs e)
55 {
56 GlobalFlag = false; //设定全局变量表示为false
57 if(comboBox1.Items.Count > 1)//当ComboBox中剩不小于2条内容时
58 {
59 DeleteID = comboBox1.SelectedItem.ToString();//将选中项转化为int型
60 if(comboBox1.Items.Count != 0)//当ComboBox中剩1条内容时
61 {
62 comboBox1.Items.Remove(comboBox1.SelectedItem);
63 comboBox1.SelectedIndex = 0;
64 }
65 }
66 UpdateData();//更新Combobox控件中的内容
67 }
68
69 private void cancelButton_Click(object sender,EventArgs e)
70 {
71 id.Clear(); //清空编号文本框中的内容
72 name.Clear();//清空姓名文本框中的内容
73 phone.Clear();//清空电话号码文本框中的内容
74 address.Clear();//清空居住地址文本框中的内容
75 id.Focus();//设定当前鼠标的焦点在编号文本框中
76 }
77
78 private void submitButton_Click(object sender,EventArgs e)
79 {
80 GlobalFlag = true; //设定标识的值为true
81 if(!(comboBox1.Items.Equals(idContent)))//当Combobox控件中不存在将添加的信息时
82 {
83 comboBox1.Items.Add(idContent);//在Combobox控件中添加一条记录
84 }
85 UpdateData();
86 }
87
88 private void id_TextChanged(object sender,EventArgs e)
89 {
90 idContent = id.Text; //保存新添加记录的编号
91 }
92
93 private void name_TextChanged(object sender,EventArgs e)
94 {
95 nameContent = name.Text;//保存填入的姓名
96 }
97
98 private void phone_TextChanged(object sender,EventArgs e)
99 {
100 phoneContent = phone.Text;//保存填入的电话号码
101 }
102
103 private void address_TextChanged(object sender,EventArgs e)
104 {
105 addressContent = address.Text;//保存填入的地址信息
106 }
107 }
108 }

Frm_Child.designer.cs

View Code
  1 namespace RefreshFormByChildForm
2 {
3 partial class Frm_Child
4 {
5 /// <summary>
6 /// Required designer variable.
7 /// </summary>
8 private System.ComponentModel.IContainer components = null;
9
10 /// <summary>
11 /// Clean up any resources being used.
12 /// </summary>
13 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14 protected override void Dispose(bool disposing)
15 {
16 if(disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }
22
23 #region Windows Form Designer generated code
24
25 /// <summary>
26 /// Required method for Designer support - do not modify
27 /// the contents of this method with the code editor.
28 /// </summary>
29 private void InitializeComponent()
30 {
31 this.PersonalInfo = new System.Windows.Forms.GroupBox();
32 this.cancelButton = new System.Windows.Forms.Button();
33 this.submitButton = new System.Windows.Forms.Button();
34 this.phone = new System.Windows.Forms.TextBox();
35 this.label4 = new System.Windows.Forms.Label();
36 this.address = new System.Windows.Forms.TextBox();
37 this.label3 = new System.Windows.Forms.Label();
38 this.name = new System.Windows.Forms.TextBox();
39 this.label2 = new System.Windows.Forms.Label();
40 this.id = new System.Windows.Forms.TextBox();
41 this.label1 = new System.Windows.Forms.Label();
42 this.groupBox1 = new System.Windows.Forms.GroupBox();
43 this.label5 = new System.Windows.Forms.Label();
44 this.deleteButton = new System.Windows.Forms.Button();
45 this.comboBox1 = new System.Windows.Forms.ComboBox();
46 this.PersonalInfo.SuspendLayout();
47 this.groupBox1.SuspendLayout();
48 this.SuspendLayout();
49 //
50 // PersonalInfo
51 //
52 this.PersonalInfo.Controls.Add(this.cancelButton);
53 this.PersonalInfo.Controls.Add(this.submitButton);
54 this.PersonalInfo.Controls.Add(this.phone);
55 this.PersonalInfo.Controls.Add(this.label4);
56 this.PersonalInfo.Controls.Add(this.address);
57 this.PersonalInfo.Controls.Add(this.label3);
58 this.PersonalInfo.Controls.Add(this.name);
59 this.PersonalInfo.Controls.Add(this.label2);
60 this.PersonalInfo.Controls.Add(this.id);
61 this.PersonalInfo.Controls.Add(this.label1);
62 this.PersonalInfo.Location = new System.Drawing.Point(6, 8);
63 this.PersonalInfo.Name = "PersonalInfo";
64 this.PersonalInfo.Size = new System.Drawing.Size(278, 147);
65 this.PersonalInfo.TabIndex = 0;
66 this.PersonalInfo.TabStop = false;
67 this.PersonalInfo.Text = "个人信息";
68 //
69 // cancelButton
70 //
71 this.cancelButton.Location = new System.Drawing.Point(212, 64);
72 this.cancelButton.Name = "cancelButton";
73 this.cancelButton.Size = new System.Drawing.Size(45, 23);
74 this.cancelButton.TabIndex = 5;
75 this.cancelButton.Text = "取消";
76 this.cancelButton.UseVisualStyleBackColor = true;
77 this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
78 //
79 // submitButton
80 //
81 this.submitButton.Location = new System.Drawing.Point(212, 20);
82 this.submitButton.Name = "submitButton";
83 this.submitButton.Size = new System.Drawing.Size(45, 23);
84 this.submitButton.TabIndex = 4;
85 this.submitButton.Text = "提交";
86 this.submitButton.UseVisualStyleBackColor = true;
87 this.submitButton.Click += new System.EventHandler(this.submitButton_Click);
88 //
89 // phone
90 //
91 this.phone.Location = new System.Drawing.Point(91, 84);
92 this.phone.Name = "phone";
93 this.phone.Size = new System.Drawing.Size(100, 21);
94 this.phone.TabIndex = 2;
95 this.phone.TextChanged += new System.EventHandler(this.phone_TextChanged);
96 //
97 // label4
98 //
99 this.label4.AutoSize = true;
100 this.label4.Location = new System.Drawing.Point(22, 87);
101 this.label4.Name = "label4";
102 this.label4.Size = new System.Drawing.Size(41, 12);
103 this.label4.TabIndex = 4;
104 this.label4.Text = "电话:";
105 //
106 // address
107 //
108 this.address.Location = new System.Drawing.Point(91, 118);
109 this.address.Name = "address";
110 this.address.Size = new System.Drawing.Size(100, 21);
111 this.address.TabIndex = 3;
112 this.address.TextChanged += new System.EventHandler(this.address_TextChanged);
113 //
114 // label3
115 //
116 this.label3.AutoSize = true;
117 this.label3.Location = new System.Drawing.Point(22, 121);
118 this.label3.Name = "label3";
119 this.label3.Size = new System.Drawing.Size(41, 12);
120 this.label3.TabIndex = 4;
121 this.label3.Text = "住址:";
122 //
123 // name
124 //
125 this.name.Location = new System.Drawing.Point(91, 52);
126 this.name.Name = "name";
127 this.name.Size = new System.Drawing.Size(100, 21);
128 this.name.TabIndex = 1;
129 this.name.TextChanged += new System.EventHandler(this.name_TextChanged);
130 //
131 // label2
132 //
133 this.label2.AutoSize = true;
134 this.label2.Location = new System.Drawing.Point(22, 55);
135 this.label2.Name = "label2";
136 this.label2.Size = new System.Drawing.Size(41, 12);
137 this.label2.TabIndex = 2;
138 this.label2.Text = "姓名:";
139 //
140 // id
141 //
142 this.id.Location = new System.Drawing.Point(91, 20);
143 this.id.Name = "id";
144 this.id.Size = new System.Drawing.Size(100, 21);
145 this.id.TabIndex = 0;
146 this.id.TextChanged += new System.EventHandler(this.id_TextChanged);
147 //
148 // label1
149 //
150 this.label1.AutoSize = true;
151 this.label1.Location = new System.Drawing.Point(22, 25);
152 this.label1.Name = "label1";
153 this.label1.Size = new System.Drawing.Size(41, 12);
154 this.label1.TabIndex = 0;
155 this.label1.Text = "编号:";
156 //
157 // groupBox1
158 //
159 this.groupBox1.Controls.Add(this.label5);
160 this.groupBox1.Controls.Add(this.deleteButton);
161 this.groupBox1.Controls.Add(this.comboBox1);
162 this.groupBox1.Location = new System.Drawing.Point(6, 164);
163 this.groupBox1.Name = "groupBox1";
164 this.groupBox1.Size = new System.Drawing.Size(278, 67);
165 this.groupBox1.TabIndex = 1;
166 this.groupBox1.TabStop = false;
167 this.groupBox1.Text = "删除信息";
168 //
169 // label5
170 //
171 this.label5.AutoSize = true;
172 this.label5.Location = new System.Drawing.Point(22, 31);
173 this.label5.Name = "label5";
174 this.label5.Size = new System.Drawing.Size(41, 12);
175 this.label5.TabIndex = 2;
176 this.label5.Text = "编号:";
177 //
178 // deleteButton
179 //
180 this.deleteButton.Location = new System.Drawing.Point(212, 24);
181 this.deleteButton.Name = "deleteButton";
182 this.deleteButton.Size = new System.Drawing.Size(45, 23);
183 this.deleteButton.TabIndex = 6;
184 this.deleteButton.Text = "删除";
185 this.deleteButton.UseVisualStyleBackColor = true;
186 this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
187 //
188 // comboBox1
189 //
190 this.comboBox1.FormattingEnabled = true;
191 this.comboBox1.Location = new System.Drawing.Point(70, 26);
192 this.comboBox1.Name = "comboBox1";
193 this.comboBox1.Size = new System.Drawing.Size(121, 20);
194 this.comboBox1.TabIndex = 0;
195 //
196 // Frm_Child
197 //
198 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
199 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
200 this.ClientSize = new System.Drawing.Size(292, 237);
201 this.Controls.Add(this.groupBox1);
202 this.Controls.Add(this.PersonalInfo);
203 this.MaximizeBox = false;
204 this.Name = "Frm_Child";
205 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
206 this.Text = "子窗体";
207 this.Load += new System.EventHandler(this.Frm_Child_Load);
208 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Frm_Child_FormClosing);
209 this.PersonalInfo.ResumeLayout(false);
210 this.PersonalInfo.PerformLayout();
211 this.groupBox1.ResumeLayout(false);
212 this.groupBox1.PerformLayout();
213 this.ResumeLayout(false);
214
215 }
216
217 #endregion
218
219 private System.Windows.Forms.GroupBox PersonalInfo;
220 private System.Windows.Forms.TextBox address;
221 private System.Windows.Forms.Label label3;
222 private System.Windows.Forms.TextBox name;
223 private System.Windows.Forms.Label label2;
224 private System.Windows.Forms.TextBox id;
225 private System.Windows.Forms.Label label1;
226 private System.Windows.Forms.Button cancelButton;
227 private System.Windows.Forms.Button submitButton;
228 private System.Windows.Forms.TextBox phone;
229 private System.Windows.Forms.Label label4;
230 private System.Windows.Forms.GroupBox groupBox1;
231 private System.Windows.Forms.Label label5;
232 private System.Windows.Forms.Button deleteButton;
233 private System.Windows.Forms.ComboBox comboBox1;
234 }
235 }







作者:墨明棋妙
出处:http://www.cnblogs.com/ynbt/
关于作者:专注于.Net、WCF和移动互联网开发。
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题,可以通过ynbt_wang@163.com联系我,非常感谢。 。
 posted on 2012-04-26 17:06  纳米程序员  阅读(372)  评论(0编辑  收藏  举报