NHenry
Messages postés15049Date d'inscriptionvendredi 14 mars 2003StatutModérateurDernière intervention25 mars 2023156 28 janv. 2008 à 13:38
Bonjour
Je suis allé voir, mais je n'arrive pas à le faire fonctionner :
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal _
wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const MCSC_BACKGROUND = 0 ' the background color (between months)
Private Const MCSC_TEXT = 1 ' the dates
Private Const MCSC_TITLEBK = 2 ' background of the title
Private Const MCSC_TITLETEXT = 3 ' text color of the title
Private Const MCSC_MONTHBK = 4 ' background within the month cal
Private Const MCSC_TRAILINGTEXT = 5 ' the text color of header & trailing days
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 202171 28 janv. 2008 à 14:27
tourne au poil :
Private Sub Command1_Click()
ChangeColors DTPicker1
ChangeColors MonthView1
End Sub
Private Sub ChangeColors(ByRef voClient As Object)
Randomize Timer
If TypeOf voClient Is DTPicker Then
voClient.CalendarBackColor = Rnd * vbWhite
voClient.CalendarForeColor = Rnd * vbWhite
voClient.CalendarTitleBackColor = Rnd * vbWhite
voClient.CalendarTitleForeColor = Rnd * vbWhite
voClient.CalendarTrailingForeColor = Rnd * vbWhite
ElseIf TypeOf voClient Is MonthView Then
voClient.BackColor = Rnd * vbWhite
voClient.MonthBackColor = Rnd * vbWhite
voClient.ForeColor = Rnd * vbWhite
voClient.TitleBackColor = Rnd * vbWhite
voClient.TitleForeColor = Rnd * vbWhite
voClient.TrailingForeColor = Rnd * vbWhite
End If
voClient.Refresh
End Sub
je pensais que ca faisait comme pour les progressbar, pour lesquels il faut passer par des messages pour en modifier la couleur...
je t'ai donc a tord orienté vers les APIs... sorry ^^