Hi,
Any of you know how to set the start day on a DateTimePicker to Monday rather than the default one which is Sunday. What I am trying is instead of DateTimePicker shwoing from Sun. to Sat., I want it to be from Mon. to Sun. Any ideas??? I found a code in VB which says we can do the same using an API call but don't know how to convert this to VB .NET. This is what it says
In the declarations of a bas module
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As
Long, ByVal wMsg As _
Long, ByVal
wParam As Long, lParam As Any) As Long
Public Const DTM_GETMONTHCAL = DTM_FIRST + 8
Public Const MCM_FIRST = &H1000
Public Const MCM_SETFIRSTDAYOFWEEK = MCM_FIRST + 15
Public Const EM_GETLINECOUNT = &HBA
____________________________________________________________
In theDropDown Sub of the DTPicker
This will set the first day to Monday
Private Sub DPPIcker1_DropDown()
Dim calHwnd As Long
calHwnd = SendMessage(DPPicker1.hwnd, DTM_GETMONTHCAL, 0&, ByVal 0&)
SendMessage calHwnd, MCM_SETFIRSTDAYOFWEEK, 0&, ByVal 6&
End Sub
Thanks
Any of you know how to set the start day on a DateTimePicker to Monday rather than the default one which is Sunday. What I am trying is instead of DateTimePicker shwoing from Sun. to Sat., I want it to be from Mon. to Sun. Any ideas??? I found a code in VB which says we can do the same using an API call but don't know how to convert this to VB .NET. This is what it says
In the declarations of a bas module
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As
Long, ByVal wMsg As _
Long, ByVal
wParam As Long, lParam As Any) As Long
Public Const DTM_GETMONTHCAL = DTM_FIRST + 8
Public Const MCM_FIRST = &H1000
Public Const MCM_SETFIRSTDAYOFWEEK = MCM_FIRST + 15
Public Const EM_GETLINECOUNT = &HBA
____________________________________________________________
In theDropDown Sub of the DTPicker
This will set the first day to Monday
Private Sub DPPIcker1_DropDown()
Dim calHwnd As Long
calHwnd = SendMessage(DPPicker1.hwnd, DTM_GETMONTHCAL, 0&, ByVal 0&)
SendMessage calHwnd, MCM_SETFIRSTDAYOFWEEK, 0&, ByVal 6&
End Sub
Thanks