//form_統一form控制項的字體
      private void FrSetting_Load(object sender, EventArgs e)
        {
            //set font
            SetFontToAllControl();
        }
       private void SetFontToAllControl()
        {
            List allControls = func.GetAllControls(this);
            allControls.ForEach
                (
                    k => k.Font = new System.Drawing.Font("標楷體", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)))
                );
        }

        private void TrimToAllControl()
        {
            List allControls = func.GetAllControls(this);
            foreach (Control ctrl in allControls)
            {
                ctrl.Text = ctrl.Text.Trim();
            }
        }

留言

熱門文章