using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace 例题4_12_单选按钮和复选框_更改字体和字型_
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked == true)
textBox1.Font = new Font("黑体",textBox1 .Font .Size ,textBox1 .Font .Style );
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if (radioButton2.Checked == true)
textBox1.Font = new Font("华文新魏", textBox1.Font.Size, textBox1.Font.Style);
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
if (radioButton3.Checked == true)
textBox1.Font = new Font("楷体_GB2312", textBox1.Font.Size, textBox1.Font.Style);
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
if (checkBox2.Checked & checkBox3.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
else if (checkBox2.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic);
else if (checkBox3.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Underline);
else
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold);
}
else
{
if (checkBox2.Checked & checkBox3.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Italic | FontStyle.Underline);
else if (checkBox2.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Italic);
else if (checkBox3.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Underline);
else
textBox1.Font = new Font(textBox1.Font, FontStyle.Regular );
}
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
if (checkBox2.Checked == true)
{
if (checkBox1.Checked & checkBox3.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
else if (checkBox1.Checked)
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic);
else if (checkBox3.Checked)
textBox1.Font = new Font(textBox1.Fo
单选按钮和复选框的使用_计算机软件及应用_IT/计算机_专业资料。程序设计报告 ... 程序代码设计 源程序: package helloworld; import java.awt.*; import javax...
复选框和单选按钮都可以接收 Click(单击)事件,当单击复选框或单选按钮时,将自动变 换其状态。 例 1:界面 代码: 例 2:界面 代码: 框架:FRAME 例子:界面 代码...
第6章 命令按钮、复选框、单选按钮和框架 章 命令按钮、复选框、 6.1 命令...在代码中直接调用按钮的 在代码中直接调用按钮的Click事件 事件 命令按钮示例1 ...
C#单选按钮和复选框_IT/计算机_专业资料。值得一看单选按钮和复选框 一、引入 两组图片,对比两种输入个人信息的方式,更喜欢哪一种?理由是什么? 图片组一: 图片...
VB单选按钮、复选框和框架VB单选按钮、复选框和框架隐藏>> 10.1 单选按钮和...Click事件。因此在代码中需要根据复选框的状态来编写代码 事件 执行相应的操作。...
掌握单选按钮控件的设置与使用 2、掌握复选框控件的设置与使用 单选按钮控件的设置与使用、复选框控件的设置与使用 单选按钮控件、复选框控件的属性设置与代码编写 ...
单选按钮、复选框及分组框控件dy_计算机软件及应用_IT/计算机_专业资料。分组...(2)代码设计: private void btnOK_Click(object sender, EventArgs e) { ...
第十章 单选按钮、复选框和框架 本章内容及要求:掌握常用控件单选钮(OptionButton)、复选框 (CheckBox)、 框架(Frame) 的常用属性、重要事件 和方法的使用; 本...
实验十一:Java 的图形界面程序单选按钮、复选框、文本框、标签 一、实验目的 熟练地掌握 Java 的图形界面程序单选按钮、复选框、文本框、标签、列表框的 编程。...
实验六习题7.4 复选框和单选按钮 Value:表示复选框或单选按钮的状态。对于单选...? 要求:编写两个命令按钮 的事件过程,只需要一行 代码。 在timer事件过程中,...
热门文档