changing the foreground color of a command button
changing the foreground color of a command button
API Declarations
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Dim i As Integer
Dim j As Integer
Rate changing the foreground color of a command button
(2(2 Vote))
'set the timer interval as 1
'the width and height of button is set as 2055 and 855 respectively.
Private Sub Form_Load()
i = 50
j = 20
End Sub
Private Sub Timer1_Timer()
Dim dc As Long
dc = GetDC(Command1.hWnd)
SetBkMode dc, transparent
SetTextColor dc, RGB(239, 3, 27)
TextOut dc, i, j, "HELLO", 5
End Sub
changing the foreground color of a command button Comments
No comments yet — be the first to post one!
Post a Comment