zoukankan      html  css  js  c++  java
  • 窗体评分系统

    namespace 项目
    {
        public partial class FrmMain : Form
        {
            public FrmMain()
            {
                InitializeComponent();
            }
            public SE[] s = new SE[3];
            private void FrmMain_Load(object sender, EventArgs e)
            {
                Initial();
                Show();
            }
            //初始化数组
            public void Initial()
            {
                SE se = new SE("张三","100",18);
                SE se1 = new SE("李四", "100", 18);
                SE se2 = new SE("王五", "100", 18);
                s[0] = se;
                s[1] = se1;
                s[2] = se2;
            }
            //绑定LvName
            public void Show()
            {
                foreach (SE item in s)
                {
                    ListViewItem list = new ListViewItem(item.id);
                    list.SubItems.Add(item.name);
                    list.SubItems.Add(item.age.ToString());
                    list.SubItems.Add(item.pingjia);
                    list.SubItems.Add(item.score.ToString());
                    lvName.Items.Add(list);
                }
            }
    
            private void 评分ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                FrmScore fs = new FrmScore();
                fs.lv = lvName.SelectedItems[0];
                fs.Show();
            }
        }

    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 FrmScore : Form
        {
            public FrmScore()
            {
                InitializeComponent();
            }
            public ListViewItem lv;
            private void FrmScore_Load(object sender, EventArgs e)
            {
                txtName.Text = lv.SubItems[1].Text;
            }
    
            private void textBox2_TextChanged(object sender, EventArgs e)
            {
               
            }
    
            private void btnScore_Click(object sender, EventArgs e)
            {
                lv.SubItems[3].Text = txtPJ.Text;
                lv.SubItems[4].Text = txtScore.Text;
                this.Close();
            }
    
            private void btnQX_Click(object sender, EventArgs e)
            {
                Application.Exit();
            }
        }
    }
  • 相关阅读:
    Python3安装
    HTML基础
    Python Socket
    python常用模块
    JSON.stringify的三个参数
    判断数组中存在重复元素
    vant-ui表单验证
    如何计算出浏览器的帧数?requestAnimationFrame
    js判断两个区间是否存在交集
    怎么在组件内部判断出是否插入了slot
  • 原文地址:https://www.cnblogs.com/chuangege/p/5806512.html
Copyright © 2011-2022 走看看