当前位置: 首页 > news >正文

网站建设流图visio百度指数 网站

网站建设流图visio,百度指数 网站,中音阶梯网站谁家建设,小程序直播平台目录 英雄信息类 因为要在两个窗体里面调用字典#xff0c;所以要写两个类来构建全局变量 添加功能 查询功能 英雄信息类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WindowsFormsApp…目录 英雄信息类 因为要在两个窗体里面调用字典所以要写两个类来构建全局变量 添加功能 查询功能 英雄信息类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WindowsFormsApplication1 {   public  class hero     {       public int Id;       public string Name;       public int Money;       public string Type;       public hero(int id,string name,int money,string type) {           Id id;           Name name;           Money money;           Type type;       }     } } 因为要在两个窗体里面调用字典所以要写两个类来构建全局变量 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WindowsFormsApplication1 {     internal class Class1     {         public Dictionarystring ,hero dic;         public Class1()         {             dic new Dictionarystring, hero();         }     } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WindowsFormsApplication1 {     class Class2     {         public static Class1 data new Class1();     } }   添加功能 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 WindowsFormsApplication1 {     public partial class Form2 : Form     {         public Form2()         {             InitializeComponent();         }         private void button1_Click(object sender, EventArgs e)         {             int id int.Parse(textBox1.Text);             string name textBox2.Text;             int money int.Parse(textBox3.Text);             string object1 textBox4.Text;             hero h new hero(id, name, money, object1);             Class2.data.dic[name] h;                         // int s Class2.data.dic[name].Money;           //  MessageBox.Show(s.ToString());         }         private void Form2_Load(object sender, EventArgs e)         {         }         private void button2_Click(object sender, EventArgs e)         {             this.Close();         }     } }   查询功能 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 WindowsFormsApplication1 {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }                 private void button2_Click(object sender, EventArgs e)         {             Form2 f new Form2();             f.ShowDialog();             NewMethod();         }         private void Form1_Load(object sender, EventArgs e)         {             NewMethod();         }         private void NewMethod()         {             this.dataGridView1.Rows.Clear();             for (int i 0; i Class2.data.dic.Keys.Count; i)             {                 string nam Class2.data.dic.Keys.ElementAt(i);                 hero h Class2.data.dic[nam];                 DataGridViewRow row new DataGridViewRow();                 row.CreateCells(dataGridView1);                 row.Cells[0].Value h.Id;                 row.Cells[1].Value h.Name;                 row.Cells[2].Value h.Money;                 row.Cells[3].Value h.Type;                 dataGridView1.Rows.Add(row);             }         }         private void button1_Click(object sender, EventArgs e)         {             if (textBox1.Text)             {                   NewMethod();             }             else             {                 this.dataGridView1.Rows.Clear();                 string name textBox1.Text;                 for (int i 0; i Class2.data.dic.Keys.Count; i)                 {                     string nam Class2.data.dic.Keys.ElementAt(i);                     if (namname)                     {                         hero h Class2.data.dic[nam];                         DataGridViewRow row new DataGridViewRow();                         row.CreateCells(dataGridView1);                         row.Cells[0].Value h.Id;                         row.Cells[1].Value h.Name;                         row.Cells[2].Value h.Money;                         row.Cells[3].Value h.Type;                         dataGridView1.Rows.Add(row);                     }                                  }             }         }          } }
http://www.w-s-a.com/news/32037/

相关文章:

  • 网站建设和运行费用qq恢复官方网站
  • 可以免费建立网站吗免费的网络营销方式
  • 天津企业设计网站建设wordpress标题字体大小
  • 上高县城乡规划建设局网站创业项目
  • 钓鱼网站在线下载广州网站设计哪里好
  • 做阿里国际网站会有成效吗wordpress微博同步
  • 西安网站建设云速网络网站运营情况怎么写
  • 免费建网站的网站微信商城分销系统方案
  • 烟台网站seo服务友情链接有哪些展现形式
  • 什么是移动网站开发免费网站开发框架
  • 做网站 创业wordpress子菜单
  • 门户网站类型有哪些权重7以上的网站
  • 政务网站建设论文android app开发教程
  • 网站开发实训h5总结个人网站注册平台要多少钱
  • 空白网站建设wordpress高亮代码过长
  • 盐城 网站开发什么叫做门户网站
  • 广东快速做网站公司哪家好本地建wordpress
  • dedecms如何做网站贵阳seo计费管理
  • 企业网站设计一般多少钱呼和浩特最好的互联网公司
  • 黄浦专业做网站海南网站策划
  • 网站开发工程师有证书考试吗织梦cms是免费的吗
  • 电子商务网站建设需要学什么门户网站推广介绍方案
  • 网站里的专题页面wordpress查询数据库结构
  • WordPress子站站群网站建设代码生成器
  • 怎么攻击织梦网站甘肃省最新消息今天
  • 赣州哪里可以做网站看装修案例的网站
  • 旅游网站专业化建设的要点php 手机网站 模板
  • wordpress百度站长主动推送长春火车站官网
  • 比较好的响应式网站wordpress博客增加音乐页面
  • 广告公司出售家具 税率江门做网站seo的