日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

c#点餐系统源码

發布時間:2023/12/20 C# 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c#点餐系统源码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

c#餐廳點餐系統源碼:

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 點餐系統 {public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){int left = Screen.PrimaryScreen.Bounds.Width / 2 - this.Width / 2;int top = Screen.PrimaryScreen.Bounds.Height / 2 - this.Height / 2;this.Location = new Point(left, top);//1.在加載的時候統計菜的數量,每樣菜都有對應的序號按鈕//循環遍歷foreach (Control control in flowLayoutPanel1.Controls){Button btn = new Button();//Controls是每樣菜的整個panel容器btn.Tag = control;foreach (Control item in control.Controls){if (item.Tag.ToString()=="index"){btn.Text = item.Text;}}btn.Size = new Size(50, 30);btn.Font = new Font("", 15);flowLayoutPanel14.Controls.Add(btn);//添加按鈕事件btn.Click += Btn_Click;}}int count = 0;private void Btn_Click(object sender, EventArgs e){ //sender參數:事件的發起者,這是哪個對象觸發的事件,那么這個sender就是誰Button clickbtn = (Button)sender;Control menu = (Control)clickbtn.Tag;Label label = new Label();foreach (Control item in menu.Controls){if (item.Tag.ToString()=="name"){label.Text = item.Text;}if (item.Tag.ToString()=="money"){count += int.Parse(item.Text); }}label.Font = new Font("",15);flowLayoutPanel15.Controls.Add(label);label39.Text = count + "¥";}} }

運行結果

總結

以上是生活随笔為你收集整理的c#点餐系统源码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。