'新建一个VB.NET 项目,把原来所有代码删了,把下面的代码复制贴上去解OK了
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的.
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
MyBase.Dispose(disposing)
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程.
Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
System.Diagnostics.DebuggerStepThrough() Private Sub InitializeComponent()
Me.RadioButton1 = New System.Windows.Forms.RadioButton
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.CheckBox1 = New System.Windows.Forms.CheckBox
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'RadioButton1
Me.RadioButton1.Name = "RadioButton1"
Me.RadioButton1.TabIndex = 1
Me.RadioButton1.Text = "红色"
'GroupBox1
Me.GroupBox1.Controls.Add(Me.RadioButton1)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "颜色"
'CheckBox1
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Text = "加粗"
'TextBox1
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.TextBox1.TabIndex = 0
Me.TextBox1.Text = "话说天下大势,分久必合,合久必分."
'Button1
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 10
Me.Button1.Text = "确定"
'Form1
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.TextBox1)
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Form1"
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Me.RadioButton1.Checked = True Then Me.TextBox1.ForeColor = System.Drawing.Color.Red
Dim style As FontStyle = FontStyle.Regular
If Me.CheckBox1.Checked = True Then style = style Or FontStyle.Bold
Me.TextBox1.Font = New Font(TextBox1.Font, style)
End Class
以上就是土嘎嘎小编为大家整理的vb.net字号与数值相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!