1. 버튼의 배경색 바꾸기. 같은 방법으로 글씨색(ForeColor)도 바꿀 수 있다. 단, 일반 커맨드버튼은 글씨색을 바꿀 수 없으므로 체크박스를 사용해야 한다.
Private Sub cmd_backcolor_Click()
Dim pickedColor As Long
' Set Cancel to True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
'Set the Flags property
CommonDialog1.Flags = cdlCCRGBInit
' Display the Color Dialog box
CommonDialog1.ShowColor
pickedColor = CommonDialog1.Color
' Set the button's background color to selected color
fm_New.cmd_user(cbo_button.ListIndex).BackColor = pickedColor
ButtonArr(cbo_button.ListIndex).btnBackColor = pickedColor
ErrHandler:
' User pressed the Cancel button
End Sub'ProjectMyPOS' 카테고리의 다른 글
| VB6 - 텍스트파일 입출력(사용자정의버튼용) (0) | 2024.06.12 |
|---|---|
| VB6 - VB코드편집창에서 마우스휠 사용(윈10 64비트) (0) | 2024.06.12 |
| VB6 - 인쇄하기 (0) | 2024.06.12 |
| VB6 - 폼의 종료버튼 동작하지 않게 하기 (0) | 2024.06.12 |
| VB6 - KeyDown Event (0) | 2024.06.12 |