設定字型
控制項:FontDialog,label
注意:FontDialog1.showApply=true FontDialog1.showColor=true FontDialog1.showEffect=true
代碼:
- If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
- Label1.Font = FontDialog1.Font
- End If
設定顏色:
控制項:ColorDialog1
- If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
- Label1.ForeColor = ColorDialog1.Color
- End If
關於複選框
- Dim italicfont, regfont As System.Drawing.Font
- italicfont = New System.Drawing.Font(Label4.Font, FontStyle.Italic)
- regfont = New System.Drawing.Font(Label4.Font, FontStyle.Regular)
- If CheckBox4.CheckState = CheckState.Checked Then
- Label4.Font = italicfont
- Else
- Label4.Font = regfont
- End If
判斷這個複選框被選中時,應該發生什麼行為? 下面的僅為借鑒
- Private Sub opt486_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt486.CheckedChanged
- If sender.checked Then
- strcomputer = "486"
- Call displaycaption() '調用某一個過程函數
- End If
- End Sub