欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C#教程

當前位置:主頁 > 軟件編程 > C#教程 >

Winform學生信息管理系統(tǒng)各子窗體剖析(3)

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C#教程|點擊: 次

先來補充一下學生信息管理系統(tǒng)登錄窗體,在完成的過程中總是遇到各種各樣的問題,對于登錄窗體的設計還是存在著一些弊端,那就是需要登錄學生信息管理系統(tǒng)時如果輸入的數(shù)據(jù)出錯不必一個個刪除,就需要在窗體上再添加一個清空寫入數(shù)據(jù)的button控件,將其屬性Text改為重置。還有一個與登錄窗口設計的屬性AcceptButton將其改為確定按鈕的唯一名字(也就是button1),因此在按下回車鍵后我們也能登錄到學生信息管理系統(tǒng)主頁面相對應的CancelButton將其改為取消按鈕的唯一名字(也就是button2),因此在按下退出鍵后也能退出登錄窗口。
需要在重置的button按鈕控件添加的Click事件的代碼為:

<span style="font-size:18px;">private void button3_Click(object sender, EventArgs e) 
{ 
 textBox1.Text = ""; 
 textBox2.Text = ""; 
}</span> 

完成改動后的登錄窗口為:

 下面就來設計一些需要都用到的子窗體。

一、學生信息添加窗體

        學生信息添加窗體窗體主要是用來添加學生信息或者修改學生信息,輸入學號、姓名、性別、出生日期、家庭住址、家庭電話和所在班級,點擊“保存”按鈕即可錄入或者修改學生信息記錄,點擊“取消”按鈕,退出學生信息添加窗體。這個窗體需要用到的控件有Label控件,TextBox控件,Button控件,Panel控件和ComboBox控件。在學生信息管理系統(tǒng)主頁面中的菜單選項中找到學生管理,再次單擊學生信息就會出現(xiàn)學生信息添加的窗口。

 二、用戶信息添加窗體

         用戶信息添加窗體主要是實現(xiàn)登錄用戶的添加操作。該窗體中包含了用戶名、密碼、確認密碼和用戶權限這些信息。當點擊“保存”按鈕時,即可以將用戶的這些信息添加到數(shù)據(jù)庫中。點擊“取消”按鈕,可以退出用戶信息添加窗體。這個窗體需要用到的控件有Label控件,TextBox控件,Button控件,Panel控件和ComboBox控件。在學生信息管理系統(tǒng)主頁面中的菜單選項中找到系統(tǒng)管理,再次單擊用戶信息就會出現(xiàn)用戶信息添加的窗口。

 三、用戶修改密碼窗體

        用戶修改密碼窗體主要是實現(xiàn)用戶修改密碼的功能。該窗體中,可以通過輸入用戶名和原密碼,然后輸入新密碼和確認新密碼,來修改用戶的登錄密碼。這個窗體需要用到的控件有Label控件,TextBox控件,Button控件,Panel控件。在學生信息管理系統(tǒng)主頁面中的菜單選項中找到系統(tǒng)管理,再次單擊用戶修改密碼就會出現(xiàn)用戶修改密碼添加的窗口。

上述三個子窗體中的取消按鈕都是一樣的代碼寫入:

<span style="font-size:18px;">private void button2_Click(object sender, EventArgs e) 
{ 
  Close(); 
}</span> 

經(jīng)過上述的改動和子窗體的添加后的完整的Form1(學生信息管理系統(tǒng)登錄窗口)的代碼為:

<span style="font-size:18px;">using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
 
namespace WindowsForms 
{ 
  public partial class Form1 : Form 
  { 
    public Form1() 
    { 
      InitializeComponent(); 
    } 
 
    private void button1_Click(object sender, EventArgs e) 
    { 
      string str = textBox1.Text;//獲取你在textBox1中輸入的信息 
      Form2 ad = new Form2(str);//創(chuàng)建一個學生信息管理系統(tǒng)主界面的對象 
      ad.Show();//點擊確定后進入學生信息管理系統(tǒng)主界面 
      this.Hide();//單擊確定后隱藏登錄窗口 
    } 
 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Application.Exit();//點擊取消退出整個程序 
    } 
 
    private void button3_Click(object sender, EventArgs e) 
    { 
      textBox1.Text = "";//這是清空你寫入的用戶名稱 
      textBox2.Text = "";//這是清空你寫入的用戶密碼 
    } 
  } 
}</span></span> 

完整的Form2(學生信息管理系統(tǒng)主頁面)的代碼為:

<span style="font-size:18px;"><span style="font-size:18px;">using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
 
namespace WindowsForms 
{ 
  public partial class Form2 : Form 
  { 
    public Form2(string s) 
    { 
      InitializeComponent(); 
      tssl_name.Text = s;//將登陸窗口textBox1輸入的信息傳遞給狀態(tài)欄Text屬性 
    } 
 
    private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Application.Exit();//單擊主菜單中的退出我們退出整個程序 
    } 
 
    private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) 
    { 
 
    } 
 
    private void toolStripButton1_Click(object sender, EventArgs e) 
    { 
      Children qq = new Children();//創(chuàng)建一個子窗體的實例 
      qq.MdiParent = this;//要求子窗體的父窗體是MDI窗體 
      qq.Show(); 
    } 
 
    private void 學生信息ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Children1 c1 = new Children1(); 
      c1.MdiParent = this; 
      c1.Show(); 
    } 
 
    private void 用戶信息ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Children2 c2 = new Children2(); 
      c2.MdiParent = this; 
      c2.Show(); 
    } 
 
    private void 用戶密碼修改ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Children3 c3 = new Children3(); 
      c3.MdiParent = this; 
      c3.Show(); 
    } 
  } 
}</span> 

完整的子窗體Children1(學生信息添加窗體)的代碼為:

<span style="font-size:18px;">using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
 
namespace WindowsForms 
{ 
  public partial class Children1 : Form 
  { 
    public Children1() 
    { 
      InitializeComponent(); 
    } 
 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Close(); 
    } 
  } 
}</span> 

完整的子窗體Children2(用戶信息添加窗體)的代碼為:

<span style="font-size:18px;">using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
 
namespace WindowsForms 
{ 
  public partial class Children2 : Form 
  { 
    public Children2() 
    { 
      InitializeComponent(); 
    } 
 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Close(); 
    } 
 
    private void s(object sender, EventArgs e) 
    { 
    } 
  } 
}</span> 

完整的子窗體Children2(用戶密碼修改窗體)的代碼為:

<span style="font-size:18px;">using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
 
namespace WindowsForms 
{ 
  public partial class Children3 : Form 
  { 
    public Children3() 
    { 
      InitializeComponent(); 
    } 
 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Close(); 
    } 
  } 
}</span> 

在登錄學生信息管理系統(tǒng)主頁面打開子窗體的界面為:

在文件中找到你所編寫的程序,打開exe運行學生信息管理系統(tǒng),檢驗是否與自己設計想象的有什么不同,不同的話進行修改調(diào)試,直到與自己預想的結(jié)果相吻合就可以了。

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助。

上一篇:C# 設計模式系列教程-外觀模式

欄    目:C#教程

下一篇:C# 設計模式系列教程-簡單工廠模式

本文標題:Winform學生信息管理系統(tǒng)各子窗體剖析(3)

本文地址:http://mengdiqiu.com.cn/a1/C_jiaocheng/6497.html

網(wǎng)頁制作CMS教程網(wǎng)絡編程軟件編程腳本語言數(shù)據(jù)庫服務器

如果侵犯了您的權利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權所有