本文共 1739 字,大约阅读时间需要 5 分钟。
??????????????????????????????????
??????????????????
????????????????????????????????
???????????????
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 WinForm??3{ public partial class Form1 : Form { public Form1() { InitializeComponent(); this.timeField.AutoSize = false; } protected override void OnLayout(LayoutEventArgs event) { base.OnLayout(event); int w = this.ClientSize.Width; int h = this.ClientSize.Height; int yoff = 4; this.timeField.Location = new Point(0, yoff); this.timeField.Size = new Size(w - 80, 30); this.button1.Location = new Point(w - 80, yoff); this.button1.Size = new Size(80, 30); yoff += 30; yoff += 4; this.pictureBox1.Location = new Point(0, yoff); this.pictureBox1.Size = new Size(w, h - yoff - 4); } private void On_Test(object sender, EventArgs e) { string timeStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); timeField.Text = timeStr; } }} Dock??????????????????????????
???Dock????Anchor??????
???????Dock????????
??Dock??????????????
转载地址:http://pzdtz.baihongyu.com/