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

   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);
        }

你可能感兴趣的:(Winform,(C#),可用类库,方法,DLL等)