⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zjyg.cs

📁 这是本人学习语言来第一次写的程序
💻 CS
📖 第 1 页 / 共 4 页
字号:
								}
							}
						}
					}
					else
					{
						MessageBox.Show("用名已经存在,请换用另外的用户名.","数据输入提示:",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
						this.textBox1.Focus();
					}
				}
			}
			catch(Exception Exc)
			{
				MessageBox.Show(Exc.Message);
				this.oleDbConnection1.Close();
			}
		}
		private void textBox11_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			switch((int)e.KeyCode)
			{
				case 13:
					button1_Click(null,null);
					break;
				case 27:
					this.Close();
					break;
				case 38:
				case 37:
					if(this.textBox10.Focused)
					{
						this.textBox9.Focus();
					}
					else
					{
						if(this.textBox9.Focused)
						{
							this.textBox8.Focus();
						}
						else
						{
							if(this.textBox8.Focused)
							{
								this.textBox7.Focus();
							}
							else
							{
								if(this.textBox7.Focused)
								{
									this.textBox6.Focus();
								}
								else
								{
									if(this.textBox6.Focused)
									{
										this.textBox5.Focus();
									}
									else
									{
										if(this.textBox5.Focused)
										{
											this.textBox4.Focus();
										}
										else
										{
											if(this.textBox4.Focused)
											{
												this.textBox3.Focus();
											}
											else
											{
												if(this.textBox3.Focused)
												{
													this.textBox11.Focus();
												}
												else
												{
													if(this.textBox11.Focused)
													{
														this.textBox2.Focus();
													}
													else
													{
														if(this.textBox2.Focused)
														{
															this.textBox1.Focus();
														}
														else
														{
															if(this.textBox1.Focused)
															{
																this.textBox10.Focus();
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
					break;
				case 40:
				case 39:
					if(this.textBox1.Focused)
					{
						this.textBox2.Focus();
					}
					else
					{
						if(this.textBox2.Focused)
						{
							this.textBox11.Focus();
						}
						else
						{
							if(this.textBox11.Focused)
							{
								this.textBox3.Focus();
							}
							else
							{
								if(this.textBox3.Focused)
								{
									this.textBox4.Focus();
								}
								else
								{
									if(this.textBox4.Focused)
									{
										this.textBox5.Focus();
									}
									else
									{
										if(this.textBox5.Focused)
										{
											this.textBox6.Focus();
										}
										else
										{
											if(this.textBox6.Focused)
											{
												this.textBox7.Focus();
											}
											else
											{
												if(this.textBox7.Focused)
												{
													this.textBox8.Focus();
												}
												else
												{
													if(this.textBox8.Focused)
													{
														this.textBox9.Focus();
													}
													else
													{
														if(this.textBox9.Focused)
														{
															this.textBox10.Focus();
														}
														else
														{
															if(this.textBox10.Focused)
															{
																this.textBox1.Focus();
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
					break;
			}
		}

		private void zjyg_Load(object sender, System.EventArgs e)
		{
			this.textBox1.Focus();
			this.textBox3.Text="否";
			this.textBox5.Text="男";
		}

		private void textBox6_TextChanged(object sender, System.EventArgs e)
		{
			string s="";
			for(int i=0;i<textBox6.Text.Length;i++)
				if(Char.IsDigit(textBox6.Text[i])==true)
					s=s+textBox6.Text[i].ToString();
			textBox6.Text=s;
			textBox6.SelectionStart=textBox6.Text.Length;
		}

		private void textBox8_TextChanged(object sender, System.EventArgs e)
		{
			string s="";
			for(int i=0;i<textBox8.Text.Length;i++)
				if(Char.IsDigit(textBox8.Text[i])==true)
					s=s+textBox8.Text[i].ToString();
			textBox8.Text=s;
			textBox8.SelectionStart=textBox8.Text.Length;
		}

		private void textBox9_TextChanged(object sender, System.EventArgs e)
		{
			string s="";
			for(int i=0;i<textBox9.Text.Length;i++)
				if(Char.IsDigit(textBox9.Text[i])==true)
					s=s+textBox9.Text[i].ToString();
			textBox9.Text=s;
			textBox9.SelectionStart=textBox9.Text.Length;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -