博客
关于我
控件的布局
阅读量:588 次
发布时间:2019-03-11

本文共 1739 字,大约阅读时间需要 5 分钟。

?????

??????????????????????????????????

????

??????????????????

  • ????????????????????
  • ???????????????????
  • ?????????????
  • ??????

    ????????????????????????????????

    • textBox?AutoSize?????false???????????????
    • distinction between???Size?ClientSize?Size?????????????ClientSize??????????
    • ????????????????OnLayout??????

    ???????????????

    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??????????????????????????

    • Top??????
    • Bottom??????
    • Left??????
    • Right??????
    • Fill?????
    • None????

    ???Dock????Anchor??????

    ????

    ???????Dock????????

  • ????Panel??????
  • ????Panel??????
  • ????PictureBox??????
  • ??Dock??????????????

    转载地址:http://pzdtz.baihongyu.com/

    你可能感兴趣的文章
    ORA-00932: inconsistent datatypes: expected - got NCLOB【ORA-00932: 数据类型不一致: 应为 -, 但却获得 NCLOB 】【解决办法】
    查看>>
    ORA-00942 表或视图不存在
    查看>>
    ORA-01034: ORACLE not available
    查看>>
    ORA-01152: 文件 1 没有从过旧的备份中还原
    查看>>
    ORA-01207:文件比控制文件更新 - 旧的控制文件
    查看>>
    ORA-01795: 列表中的最大表达式数为 1000
    查看>>
    ORA-06575: 程序包或函数 NO_VM_DROP_PROC 处于无效状态
    查看>>
    ORA-08102的错误
    查看>>
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor异常
    查看>>
    ORA-12514: TNS:listener does not currently know of service问题原因
    查看>>
    ora-12541:tns:no listener
    查看>>
    【docker知识】联合文件系统(unionFS)原理
    查看>>
    ORACEL学习--理解over()函数
    查看>>
    ORAchk-数据库健康检查
    查看>>
    oracle 10g crs命令,Oracle 10g CRS安装问题解决一例
    查看>>
    Oracle 10g ORA-01034: ORACLE not available 错误
    查看>>
    oracle 10g的安装配置
    查看>>
    Oracle 11.2.0.4 x64 RAC修改public/private/vip/scan地址
    查看>>
    Oracle 11G INDEX FULL SCAN 和 INDEX FAST FULL SCAN 对比分析
    查看>>
    viewpage listview gridview加载本地大图多图OOM处理办法
    查看>>