标题:求教一个C#界面问题
只看楼主
xiaoqiangxh
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-12-10
结帖率:50%
已结贴  问题点数:20 回复次数:5 
求教一个C#界面问题
把窗体平分成四份,每份要显示一张图片,图片下面显示姓名,部门,性别,控件要求自动生成
搜索更多相关主题的帖子: 百姓 姓名 
2012-12-10 10:52
z909562139
Rank: 2
等 级:论坛游民
帖 子:32
专家分:87
注 册:2012-11-5
得分:0 
你看明白您要什么效果
2012-12-10 11:25
hg87520
Rank: 2
等 级:论坛游民
帖 子:1
专家分:20
注 册:2012-12-10
得分:20 
先做一个小控件,上部放着picturebox,下面使用lable,给出几个属性:图片,部门,性别。再做一个外部的大控件,里面放着一个lablelayout控件,分成四份,然后把前面做的小控件放进去,直接拉进去或者动态生成都行,并且附上前面几个属性
2012-12-10 11:27
青春无限
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:江苏
等 级:贵宾
威 望:24
帖 子:3450
专家分:19340
注 册:2012-3-31
得分:0 
k看看

学 会看代码…学习写程序…学会搞开发…我的目标!呵呵是不是说大话啊!!一切皆可能
2012-12-10 11:43
xiaoqiangxh
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-12-10
得分:0 
回复 3楼 hg87520
能给个代码示范么
2012-12-10 12:06
countrymyth
Rank: 2
等 级:论坛游民
帖 子:5
专家分:11
注 册:2011-10-28
得分:0 
private void Form1_Load(object sender, EventArgs e)
        {
            panel0 = new Panel();
            panel0.Location = new System.Drawing.Point(0, 0);
            panel0.Size = this.ClientRectangle.Size;
            this.Controls.Add(panel0);

            Size mSize = new System.Drawing.Size(panel0.Width / 2, panel0.Height / 2);

            panel1 = new Panel();
            panel1.Location = new System.Drawing.Point(0, 0);
            panel1.Size = mSize;
            this.panel0.Controls.Add(panel1);

            panel2 = new Panel();
            panel2.Location = new System.Drawing.Point(panel0.Width / 2, 0);
            panel2.Size = mSize;
            this.panel0.Controls.Add(panel2);

            panel3 = new Panel();
            panel3.Location = new System.Drawing.Point(0, panel0.Height / 2);
            panel3.Size = mSize;
            this.panel0.Controls.Add(panel3);

            panel4 = new Panel();
            panel4.Location = new System.Drawing.Point(panel0.Width / 2, panel0.Height / 2);
            panel4.Size = mSize;
            this.panel0.Controls.Add(panel4);

            ptb1 = new PictureBox();
            ptb1.Location = this.panel1.Location;
            ptb1.Size = new System.Drawing.Size(this.panel1.Width, this.panel1.Height / 2);
            ptb1.Image = Image.FromFile(@"E:\Sunset.jpg");
            this.panel1.Controls.Add(ptb1);

            Label lable1;

            lable1 = new Label();
            lable1.Location = new System.Drawing.Point(this.panel1.Width/3, this.panel1.Height / 2);
            lable1.Text = "姓名:张三";
            this.panel1.Controls.Add(lable1);

            lable1 = new Label();
            lable1.Location = new System.Drawing.Point(this.panel1.Width / 3, this.panel1.Height / 2 + 30);
            lable1.Text = "性别:男";
            this.panel1.Controls.Add(lable1);
            //....
2012-12-10 14:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-390403-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.185020 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved