winform 给textbox 增加 或 减小字体大小 z

   private void btnAddFont_Click(object sender, EventArgs e)
        {
            float fSize = this.txtResult.Font.Size;
           
            if (fSize > 22.0) { return; }

            fSize = fSize + 1;
            txtResult.Font = new Font(txtResult.Font.FontFamily, fSize, txtResult.Font.Style);
        }

        private void btnSubtractFont_Click(object sender, EventArgs e)
        {
            float fSize = this.txtResult.Font.Size;

            if (fSize <6.0) { return; }

            fSize = fSize - 1;
            txtResult.Font = new Font(txtResult.Font.FontFamily, fSize, txtResult.Font.Style);
        }

 

posted on 2018-05-03 08:30  武胜-阿伟  阅读(764)  评论(0编辑  收藏  举报