#中lable及其内容怎样随对话框的改变成比例的改变 C#中lable及其内容怎样随对话框的改变成比例的改变,窗体中有四个lable控件,两行两列排列对话框c# 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { label1.AutoSize = false; label1.Dock = DockStyle.Left; label1.TextAlign = ContentAlignment.MiddleLeft; label2.AutoSize = false; label2.Dock = DockStyle.Right; label2.TextAlign = ContentAlignment.MiddleRight; label3.AutoSize = false; label3.Dock = DockStyle.Top; label3.TextAlign = ContentAlignment.TopCenter; label4.AutoSize = false; label4.Dock = DockStyle.Bottom; label4.TextAlign = ContentAlignment.BottomCenter; Label[] labels = { label1, label2, label3, label4 }; foreach (Label l in labels) { l.Font = new Font(l.Font.Name, this.Height / 15); l.Size = new Size(Width / 3, Height / 3); } } private void Form1_Resize(object sender, EventArgs e) { Label[] labels = { label1, label2, label3, label4 }; foreach (Label l in labels) { l.Font = new Font(l.Font.Name, this.Height / 15); l.Size = new Size(Width / 3, Height / 3); } } }}在界面上摆4个label,然后编写两个事件处理函数,如代码。 我想做成这个样子的,上下数据对应着,在改变对话框时lable成比例的改变,该怎么实现呢,谢谢 好像可以用 tablelayoutpanel 来实现布局,和你要的需求 删除日志提问 对路径“G:\ww”的访问被拒绝。 ObsoleteAttribute 实现问题? 关于数字证书的提供者的疑惑 如何把加到控件事件队列中的所有事件清除? 求 C# 井字棋、绘图板,调色板 或思路 引用MYSQL.DATA.DLL的类,在用户机器上运行后无法创建对象 没解决在出100分请懂C的帮忙翻译成C#,请调试正确,成功后请去另一个贴回复共得200分 给定一个日期,如何确定他是星期几呢? @是什么意思? C#在不同线程中如何设置一个窗体是另一个窗体的父窗体 如何绑定datagrid某一列作为数据源??
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
label1.AutoSize = false;
label1.Dock = DockStyle.Left;
label1.TextAlign = ContentAlignment.MiddleLeft;
label2.AutoSize = false;
label2.Dock = DockStyle.Right;
label2.TextAlign = ContentAlignment.MiddleRight;
label3.AutoSize = false;
label3.Dock = DockStyle.Top;
label3.TextAlign = ContentAlignment.TopCenter;
label4.AutoSize = false;
label4.Dock = DockStyle.Bottom;
label4.TextAlign = ContentAlignment.BottomCenter;
Label[] labels = { label1, label2, label3, label4 };
foreach (Label l in labels)
{
l.Font = new Font(l.Font.Name, this.Height / 15);
l.Size = new Size(Width / 3, Height / 3);
}
} private void Form1_Resize(object sender, EventArgs e)
{
Label[] labels = { label1, label2, label3, label4 };
foreach (Label l in labels)
{
l.Font = new Font(l.Font.Name, this.Height / 15);
l.Size = new Size(Width / 3, Height / 3);
}
}
}
}在界面上摆4个label,然后编写两个事件处理函数,如代码。