VB 用自定义颜色对话框设置字体颜色

2024-12-19 11:15:17
推荐回答(2个)
回答1:

Private Sub Command1_Click()
'这时最好也启用它的CancelError
CommonDialog1.CancelError = True
'再调用错误处理
On Error Goto Wrongs
CommonDialog1.Flags = 1
CommonDialog1.Action = 3 '上移
Label1.ForeColor = CommonDialog1.Color
Exit Sub
Wrongs:
Msgbox "用户点击了取消"
End Sub

回答2:

汗.你command click以后才触发颜色设置.貌似应该放在form load里吧.第二歌问题也是一样.