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);
}
}
}
}

最新文章

  1. MapReduce实现手机上网流量分析(业务逻辑)
  2. 根据字符长度动态确定UIlabel宽高
  3. Orchard学习笔记
  4. HTML5调用手机相机拍照
  5. linux下用户账户切换
  6. 130 个你需要了解的 vim 命令
  7. 用SQL server导出到oracle,查询时提示“表或视图不存在ORA-00942”错误
  8. iOS- 微信支付 (服务器调起支付 )以及回调不成功的原因 不看后悔
  9. 配置spring的事务管理
  10. 淺析LED、LED背光、OLED的技術原理與區別
  11. windows nfs server for linux
  12. 欢迎大家关注我的微信公众帐号小q机器人(xiaoqrobot)(转)
  13. vim 环境设定(通用)
  14. EsayUi中常用的属性和方法总结
  15. NAT转换、VLAN与Trunk(特典:ACL初步)
  16. 工程设计文档服务EngineerCMS
  17. 无需AutoCAD,用C#生成DWG文件
  18. Pyspider抓取静态页面
  19. mongoexport
  20. 一些jquery常用方法

热门文章

  1. 最近面试的题目(WEB、Service、SQL、JavaScript)
  2. oracle重建控制文件
  3. 20145320《Java程序设计》第二次实验报告
  4. Robot framework + appium环境搭建
  5. 设计模式_11_原型模式(prototype)深拷贝、浅拷贝
  6. C++学习笔记(1)——数据类型占空间大小
  7. DOM解析
  8. JavaWeb应用开发架构浅谈
  9. Dynamics AX 2012 R2 AIF自定义服务中的事务回滚Bug
  10. Unix/Linux编程实践教程(0:文件、终端、信号)