Click here to Skip to main content
16,012,759 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
how to show calendar on datetimepicker when click button ?

What I have tried:

----------------------------------------------------------------------------------------
Posted
Updated 12-Sep-17 6:25am
Comments
Graeme_Grant 11-Sep-17 19:05pm    
You should learn how to use Google Search rather than always get us to write your code for you: vb how to show calendar on datetimepicker using button?[^]
Khabibb Mubarakk 12-Sep-17 6:33am    
I didn't find control,,it cause i post here
Graeme_Grant 12-Sep-17 6:42am    
Both Karthik Bangalore and I have given you links with valid solutions. Now it is up to you.

1 solution

check this winforms - Open DateTimePicker C# control programatically - Stack Overflow[^] the answer is posted in c# however you shall use any one of the online code converter to convert from c# to vb
 
Share this answer
 
Comments
Khabibb Mubarakk 12-Sep-17 7:16am    
i got error message
 Unable to find an entry point named 'PostMessage' in DLL 'user32.dll'. 

this the code
'part of the usings
Imports System.Runtime.InteropServices

    
    'declares
    Private Declare Function PostMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal msg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Boolean
    
    Private Const WM_LBUTTONDOWN As Int32 = 513
    
    'method to call dropdown
    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) handles button1.click
        Dim x As Int32 = (dateTimePicker1.Width - 10)
        Dim y As Int32 = (dateTimePicker1.Height / 2)
        Dim lParam As Int32 = (x + (y * 65536))
        PostMessage(dateTimePicker1.Handle, WM_LBUTTONDOWN, 1, lParam)
    End Sub
Karthik_Mahalingam 12-Sep-17 9:21am    
check this
https://stackoverflow.com/a/12885084/1147428
https://stackoverflow.com/a/39293384/1147428

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900