设置字体与颜色

 设置字体

控件:FontDialog,label

注意:FontDialog1.showApply=true      FontDialog1.showColor=true       FontDialog1.showEffect=true

代码:

  1.    If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  2.             Label1.Font = FontDialog1.Font
  3.         End If

设置颜色:

控件:ColorDialog1

  1. If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  2.             Label1.ForeColor = ColorDialog1.Color
  3.         End If

关于复选框

  1. Dim italicfont, regfont As System.Drawing.Font
  2.         italicfont = New System.Drawing.Font(Label4.Font, FontStyle.Italic)
  3.         regfont = New System.Drawing.Font(Label4.Font, FontStyle.Regular)
  4.         If CheckBox4.CheckState = CheckState.Checked Then
  5.             Label4.Font = italicfont
  6.         Else
  7.             Label4.Font = regfont
  8.         End If

 

判断这个复选框被选中时,应该发生什么行为?    下面的仅为借鉴

  1. Private Sub opt486_CheckedChanged(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles opt486.CheckedChanged
  2.         If sender.checked Then
  3.             strcomputer = "486"
  4.             Call displaycaption()   '调用某一个过程函数
  5.         End If
  6.     End Sub

 

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值