今天 做了 簡單的字體改變應用程式
需要
一個 TextBox 三個 GroupBox 其中兩個 GroupBox 內各有 兩個 RadioButton 另一個GroupBoxs
內有三個 RadioButton

這樣做

以下為程式碼

Public Class Form1

Private Sub rbtType1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtType1.CheckedChanged
txtShow.Font = New Font("新細明體", 20, txtShow.Font.Style)

End Sub

Private Sub rbtType2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtType2.CheckedChanged
txtShow.Font = New Font("標偕體", 20, txtShow.Font.Style)
End Sub

Private Sub rbtColorRed_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtColorRed.CheckedChanged
txtShow.ForeColor = Color.Red
End Sub

Private Sub rbtColorGreen_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtColorGreen.CheckedChanged
txtShow.ForeColor = Color.Green
End Sub

Private Sub rbtColorBlue_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtColorBlue.CheckedChanged
txtShow.ForeColor = Color.Blue
End Sub

Private Sub rbtNormal_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtNormal.CheckedChanged
txtShow.Font = New Font(txtShow.Font.Name, 20, FontStyle.Regular)
End Sub

Private Sub rbtBold_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtBold.CheckedChanged
txtShow.Font = New Font(txtShow.Font.Name, 20, FontStyle.Bold)
End Sub
End Class

完成後如下圖

創作者介紹

↖Ι n V a D e R ╮

ip612256374 發表在 痞客邦 留言(0) 人氣()