当前位置:网站首页>C examples of using colordialog to change text color and fontdialog to change text font
C examples of using colordialog to change text color and fontdialog to change text font
2022-06-25 08:01:00 【ykxxcs】
c#ColorDialog Change the text color and FontDialog Example of changing text font

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// Display the color dialog ColorDialog
private void button1_Click(object sender, EventArgs e)
{
DialogResult dr = colorDialog1.ShowDialog();
// If color is selected , single click “ determine ” Button changes the text color of the text box
if (dr == DialogResult.OK)
{
textBox1.ForeColor = colorDialog1.Color;
}
}
// Change text font and other dialog boxes FontDialog
private void button2_Click(object sender, EventArgs e)
{
DialogResult dr = fontDialog1.ShowDialog();
// If font is selected , single click “ determine ” Button changes the text font of the text box
if (dr == DialogResult.OK)
{
textBox1.Font = fontDialog1.Font;
}
}
}
边栏推荐
- To understand the difference between Gram-positive and Gram-negative bacteria and the difference in pathogenicity
- 420-二叉树的层序遍历2(429. N 叉树的层序遍历、515.在每个树行中找最大值、116.填充每个节点的下一个右侧节点指针、104.二叉树的最大深度、111.二叉树的最小深度)
- Apache CouchDB 代码执行漏洞(CVE-2022-24706 )批量POC
- [daily training] 207 Class Schedule Card
- Opencv daily function structure analysis and shape descriptor (8) Fitline function fitting line
- What are the problems with traditional IO? Why is zero copy introduced?
- Can transparent cloud gateway caniot and candtu record can messages and send and receive can data remotely
- 电子学:第012课——实验 13:烧烤 LED
- Can bus working condition and signal quality "physical examination"
- Analysis of kinsing dual platform mining family virus
猜你喜欢

共话云原生数据库的未来

Looking for b-end product manager after years? I almost ruined myself

420-二叉树的层序遍历2(429. N 叉树的层序遍历、515.在每个树行中找最大值、116.填充每个节点的下一个右侧节点指针、104.二叉树的最大深度、111.二叉树的最小深度)

Solving some interesting problems with recurrence of function

50 pieces of professional knowledge of Product Manager (IV) - from problem to ability improvement: amdgf model tool

环网冗余式CAN/光纤转换器的CAN光端机在消防火灾联网报警系统中的应用

电子学:第014课——实验 15:防入侵报警器(第一部分)

电子学:第010课——实验 8:继电振荡器

飞机引气系统的建模与故障仿真

基于RBAC 的SAAS系统权限设计
随机推荐
基于Anaconda的模块安装与注意事项
PCB board design - automatic layout 2021-10-15
电子学:第012课——实验 13:烧烤 LED
环网冗余式CAN/光纤转换器的CAN光端机在消防火灾联网报警系统中的应用
Is it safe to open an account through the haircut account opening link now?
CAN透传云网关CANIOT,CANDTU记录CAN报文远程收发CAN数据
Apache CouchDB 代码执行漏洞(CVE-2022-24706 )批量POC
剑指offer刷题(中等等级)
协议和服务的区别?
將數據導入到MATLAB
【补题】2021牛客暑期多校训练营9-n
50. pow (x, n) - fast power
c#中设置lable控件的TextAlign属性控制文字居中的方法
C WinForm panel custom picture and text
Ubuntu18下登录mysql 5.7设置root密码
Atlassian Confluence 远程代码执行漏洞(CVE-2022-26134漏洞分析与防护
27. remove elements
Dietary intervention reduces cancer treatment-related symptoms and toxicity
Anaconda based module installation and precautions
洛谷P2839 [国家集训队]middle(二分 + 主席树 + 区间合并)