zoukankan      html  css  js  c++  java
  • 自定义控件

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class TestControl : UserControl
        {
            private string UserName="";
            public TestControl()
            {
                InitializeComponent();
            }
            public TestControl(string uid)
            {
                InitializeComponent();
                UserName = uid;
            }
    
            private void TestControl_Load(object sender, EventArgs e)
            {
                YongHuDA da = new YongHuDA();
                YongHu data = da.Select(UserName);
    
                pictureBox1.BackgroundImage = Image.FromFile(data.Pic);
                pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
    
                label1.Text = data.Nick;
                label2.Text = data.Qian;
    
                button1.Tag = data.Uid;
            }
    
            private void pictureBox1_Click(object sender, EventArgs e)
            {
                //label1.Text;
                this.ParentForm.Controls["label1"].Text = label1.Text;
    
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
    
            }
    
           
    
    
    
        }
    }
    

      

    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 Form1_Load(object sender, EventArgs e)
            {
                YongHuDA da = new YongHuDA();
                List<YongHu> list = da.Select();
    
                foreach (YongHu data in list)
                {
                    TestControl ctrl = new TestControl(data.Uid);
                    flowLayoutPanel1.Controls.Add(ctrl);
                }
            }
        }
    }
  • 相关阅读:
    SAP实施方法与过程——ASAP
    标准SAP中的物料类型
    SMARTFORM报表程序设计(2)
    SMARTFORM报表程序设计(1)
    关于c#中的Timer控件的简单用法
    SAP Connector 3.0 .Net 开发
    SAP MRP的计算步骤
    PP常见数据表
    实战项目:通过当当API将订单抓取到SAP(二)
    实战项目:通过当当API将订单抓取到SAP(一)
  • 原文地址:https://www.cnblogs.com/kun-boke/p/5885531.html
Copyright © 2011-2022 走看看