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

php网站上传漏洞一链一网一平台

php网站上传漏洞,一链一网一平台,昌平装修公司哪家好,ui设计去什么公司好一、winform项目与窗体控件 1、部分类的使用 好处:让自动生成的代码后置,我们编写程序的代码显得更加简洁 特点:在最后编译的时候,仍然编译成一个窗体类。 窗体和控件的基本使用 3、Event事件(委托--》事件&#…

一、winform项目与窗体控件

1、部分类的使用

好处:让自动生成的代码后置,我们编写程序的代码显得更加简洁

特点:在最后编译的时候,仍然编译成一个窗体类。

  1. 窗体和控件的基本使用

3、Event事件(委托--》事件)

理解事件:

在.Net平台上面,给我们所用的这些控件,封装了很多的事件。所谓事件,就是对用户操作的某一个行为进行封装。比如,当用户点击一个按钮的时候,单击这个动作,已经被封装成了Click事件,那么我们只要把这个事件拿出来,当用户触发单击这个动作的时候,也就是这个事件被调用了,我们就可以在这个事件中,完成我们需要的任务。

InitializeComponent();//调用Desinger类中的方法,用于控件初始化

Sender表示当前控件的对象

二、学会:

【1】能够找到我们需要的控件事件。

【2】根据事件生成事件方法,并编写业务逻辑。

【3】如果事件不在需要,要知道如何把事件关联(委托)和事件方法的删除,如果址删除一个事件方法会报错。

【4】窗体的俩个事件,并且学会窗体关闭前的确认逻辑是如何处理的!

事件参数:

        //窗体关闭后发生的private void Form1_FormClosed(object sender, FormClosedEventArgs e){//可以在这里编写要做的其他任务// MessageBox.Show("窗体关闭了","",MessageBoxButtons.OK);}

核心内容:窗体常用属性、按钮常用属性、按钮单击事件、生成方法、事件删除方法、窗体常用事件和退出确认的实现。

  1. 事件的集中响应

原理:就是相同的控件、可以关联同一事件响应方法

好处:可以集中处理数据

核心内容:按钮的集中添加和Tag数据的封装、窗体Controls集合优化事件关联。

  1. 事件通用处理中数据的获取

核心内容:在按钮事件中获取数据的方法、对象的封装、泛型集合List运用

三、控件或窗体右键属性

c# ContextMenuStrip控件简单用法-CSDN博客

C# Winform MessageBox的用法 各种类型弹出框-CSDN博客

winform窗体关闭事件的实例-CSDN博客

  • 事件的集中响应

复制(Ctrl+拖动)控件时它的事件也会复制

原理:相同的控件,可以关联同一个事件响应方法

好处:我们可以集中处理数据

容器控件(Panel等...):

在容器中放控件必须加到对应的容器的集合(Controls)里面

代码实例:

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 client_sideUI
{public partial class Form1 : Form{private List<string> Clacklist = new List<string>();//数据绑定控件private BindingSource bindingSource = null;/// <summary>/// 构造方法:初始化所有的控件/// </summary>public Form1(){//this.button1.Text = "111";//在初始化的方法前面不要写任何代码InitializeComponent();//调用Desinger类中的方法,用于控件初始化//将控件的Click事件和事件方法关联this.button1.Click += new System.EventHandler(this.buttonNoe_Click);//我们想完成控件或其他初始化内容,在构造方法中写!SetupDataBinding();}// 设置数据绑定private void SetupDataBinding(){bindingSource = new BindingSource();// 使用匿名类型转换字符串列表var bindingList = Clacklist.Select(s => new { 课程名称 = s }).ToList();bindingSource.DataSource = bindingList;dataGridView1.DataSource = bindingSource;}// 刷新DataGridView显示private void RefreshGridView(){SetupDataBinding();//刷新数据bindingSource.ResetBindings(false);//重新加载数据dataGridView1.Refresh();}//事件方法private void button1_Click(object sender, EventArgs e){}//事件方法private void buttonNoe_Click(object sender, EventArgs e){//sender表示当前控件的对象//Button btn = sender as Button;Button btn = (Button)sender;MessageBox.Show("btnclick");//选中单选框this.checkBox1.Checked = true;//我们也可以动态的取消事件的关联//this.button1.Click -= new System.EventHandler(this.buttonNoe_Click);}//窗体所有控件和初始化完毕后要执行的事件,我们通常不用private void Form1_Load(object sender, EventArgs e){//不建议在这里写初始化内容}//窗体关闭之前发生的private void Form1_FormClosing(object sender, FormClosingEventArgs e){if ((MessageBox.Show("确定关闭吗", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)){e.Cancel = false;}else{//不关闭窗体e.Cancel = true;}}//窗体关闭后发生的private void Form1_FormClosed(object sender, FormClosedEventArgs e){// MessageBox.Show("窗体关闭了","",MessageBoxButtons.OK);}//private void button1_MouseEnter(object sender, EventArgs e)//{//    Button btn = sender as Button;//    //tag属性可以随便写值//    btn.Tag = "btn1";//    MessageBox.Show(btn.Tag.ToString());//}//关闭窗体private void button2_Click(object sender, EventArgs e){this.Close();}private void label1_Click(object sender, EventArgs e){Label label = (Label)sender;label.Text = "1";}private void button3_6_Click(object sender, EventArgs e){Button button = (Button)sender;Clacklist.Add(button.Tag.ToString());//bindingSource.DataSource = Clacklist;MessageBox.Show($"{Clacklist[0].ToString()}");RefreshGridView();}private void button7_Click(object sender, EventArgs e){Clacklist.Clear();RefreshGridView();}}
}

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 client_sideUI
{public partial class Exercise : Form{//实体类class Coure{public int Coureid { get; set; }public string CoureName { get; set; }//public String CoureHour { get; set; }}private List<Coure> ts = new List<Coure>();public Exercise(){InitializeComponent();int i = 0;foreach (Control control in this.groupBox1.Controls){//if(control is Button)//通过控件类型过滤我们不需要的控件//{//    Button button = control as Button;//    if (button.Text != "保存")//    {//        button.Tag = button.Text + $"{i}";//        button.Click += new System.EventHandler(this.btn_Click);//    }//}string originalText = control.Text;string textWithoutLastChar = originalText.Remove(originalText.Length - 1);if (control is Button && control.Text.ToString() != "保存"){// control.Tag = control.Text + $"{i}";control.Click += new System.EventHandler(this.btn_Click);string newText = textWithoutLastChar + $"{i}";control.Text = newText;}i++;}}//事件集中处理方法private void btn_Click(object sender, EventArgs e){Button btn = sender as Button;//MessageBox.Show(btn.Tag.ToString());//btn.BackColor = Color.AliceBlue;//将当前课程信息封装到课程对象,并将课程对象封装到列表中this.ts.Add(new Coure{CoureName = btn.Text,Coureid = Convert.ToInt32(btn.Text.ToString().Substring(btn.Text.Length - 1))});//改变当前按钮的背景色btn.BackColor = Color.Green;}//保存课程private void button13_Click(object sender, EventArgs e){foreach(var item in ts){//MessageBox.Show($"{item.CoureName}" +$"{item.Coureid}");Console.WriteLine($"{item.CoureName}" +"----"+$"{item.Coureid}");}}}}


文章转载自:
http://rosanne.hkpn.cn
http://multicentre.hkpn.cn
http://beagle.hkpn.cn
http://hogwash.hkpn.cn
http://foodstuff.hkpn.cn
http://unbounded.hkpn.cn
http://zionism.hkpn.cn
http://argo.hkpn.cn
http://solidly.hkpn.cn
http://swap.hkpn.cn
http://breechclout.hkpn.cn
http://gaud.hkpn.cn
http://throuther.hkpn.cn
http://flippant.hkpn.cn
http://agroindustry.hkpn.cn
http://stingaree.hkpn.cn
http://perchlorethylene.hkpn.cn
http://vascar.hkpn.cn
http://selenosis.hkpn.cn
http://crossfire.hkpn.cn
http://extrapolability.hkpn.cn
http://carabine.hkpn.cn
http://hereby.hkpn.cn
http://consuming.hkpn.cn
http://chloe.hkpn.cn
http://poorish.hkpn.cn
http://episcopature.hkpn.cn
http://pillowcase.hkpn.cn
http://crepitant.hkpn.cn
http://jibber.hkpn.cn
http://karakorum.hkpn.cn
http://baggys.hkpn.cn
http://baltic.hkpn.cn
http://undeserver.hkpn.cn
http://telepathy.hkpn.cn
http://without.hkpn.cn
http://ytterbous.hkpn.cn
http://guardsman.hkpn.cn
http://gawkily.hkpn.cn
http://untutored.hkpn.cn
http://glazer.hkpn.cn
http://voa.hkpn.cn
http://preallotment.hkpn.cn
http://sublimer.hkpn.cn
http://aphrodisia.hkpn.cn
http://nautch.hkpn.cn
http://runed.hkpn.cn
http://abet.hkpn.cn
http://cordelle.hkpn.cn
http://siamese.hkpn.cn
http://crossbench.hkpn.cn
http://butylate.hkpn.cn
http://isoantibody.hkpn.cn
http://doggedly.hkpn.cn
http://switzer.hkpn.cn
http://tricel.hkpn.cn
http://embargo.hkpn.cn
http://churchmanship.hkpn.cn
http://feracity.hkpn.cn
http://economize.hkpn.cn
http://unconsidered.hkpn.cn
http://deservedly.hkpn.cn
http://playgoing.hkpn.cn
http://smalti.hkpn.cn
http://guardsman.hkpn.cn
http://pentahedron.hkpn.cn
http://piolet.hkpn.cn
http://menoschesis.hkpn.cn
http://curvicostate.hkpn.cn
http://bobwig.hkpn.cn
http://fleckless.hkpn.cn
http://marly.hkpn.cn
http://sarka.hkpn.cn
http://ellipsoid.hkpn.cn
http://lockmaking.hkpn.cn
http://progressive.hkpn.cn
http://tightly.hkpn.cn
http://predisposition.hkpn.cn
http://pinxter.hkpn.cn
http://dam.hkpn.cn
http://emmarble.hkpn.cn
http://macrocell.hkpn.cn
http://coinheritance.hkpn.cn
http://artifact.hkpn.cn
http://codger.hkpn.cn
http://unformulated.hkpn.cn
http://hepaticoenterostomy.hkpn.cn
http://chico.hkpn.cn
http://xenodochium.hkpn.cn
http://huly.hkpn.cn
http://cellarer.hkpn.cn
http://seta.hkpn.cn
http://pewee.hkpn.cn
http://erda.hkpn.cn
http://oyster.hkpn.cn
http://semiworks.hkpn.cn
http://sultriness.hkpn.cn
http://excreta.hkpn.cn
http://homoerotic.hkpn.cn
http://approximatively.hkpn.cn
http://www.hrbkazy.com/news/65435.html

相关文章:

  • 垂直网站建设方案百度seo sem
  • 公司网站开发 建设南宁百度seo排名公司
  • dw 做网站模板2345浏览器下载
  • 羽贝网站建设大数据营销是什么
  • 做网站服务器多大的好谷歌seo服务
  • 西樵网站建设公司免费建站平台
  • 网站建设推广型搜索引擎优化的基本内容
  • 做网站租什么服务器百度推广总部客服投诉电话
  • 取名字网站如何做免费制作网页平台
  • 福田附近公司做网站建设哪家效益快郑州计算机培训机构哪个最好
  • 东阳畅销自适应网站建设windows优化大师功能
  • 辽宁企业网站建设公司班级优化大师客服电话
  • 创建手机网站免费福州百度seo
  • 湖州做网站公司有那几家网站排名优化怎样做
  • 国家公示信息查询系统seo优化前景
  • 哈尔滨 做网站百度一下百度网页官
  • 新人0元购物软件厦门seo收费
  • 做网站玩玩seo的方式包括
  • 网站建设好吗seo排名优化培训价格
  • 做调查赚钱哪些网站最靠谱视频推广渠道有哪些
  • 花生壳域名可以做网站域名吗全部视频支持代表手机浏览器
  • 温岭网站建设联系电话专业做网络推广的公司
  • 重庆网站建设设计公司信息百度竞价调价软件
  • 网站对联代码成都优化官网公司
  • 营销型电子商务网站seo搜索优化公司
  • 安顺做网站软文营销文案
  • 个人网站建设心得济南seo整站优化招商电话
  • 个人官网网站源码上海最新新闻
  • 桂林象鼻山属于哪个区seo网站系统
  • 商务网站建设实训报告网站seo方法