• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 463
  • Last Modified:

Datepicker dropdown

Hi Experts,

How do I make the datetimepicker dropdown in vb.net?

Regards,
Joe
0
JoeBo747
Asked:
JoeBo747
  • 5
  • 4
  • 2
  • +1
1 Solution
 
ethothsCommented:
Why not use a datetimepicker control...
System.Windows.Forms.DateTimePicker();

0
 
zoofanCommented:
Agreed,  on your toolbox bar under "Windows Forms" click and drage the "DateTimePicker" out onto your form


zf
0
 
JoeBo747Author Commented:
Hi ethoths: & zoofan:

Thank you for replying, I am using a System.Windows.Forms.DateTimePicker() but I cannot find the method to get the control to dropdown on a click event!

Regards,
Joe
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
zoofanCommented:
Double Click the DatePicker once its on your form,  it will automatically take you to the code.
THen on the top right click the drop down list for that obejts properties and select click,
it wil add the click code sub for you



zf
0
 
zoofanCommented:
You will then need to run the app in the ide to actually see it work.

zf
0
 
JoeBo747Author Commented:
Hi zoofan:

I dont think I have explained myself clearly I have a click event ColDate  whos click event is set to the following:

Me.DateTimePicker1.Top = Me.ColDate.Top
        StrCtrl = "ColDate"
        Me.DateTimePicker1.Left = 139
        Me.DateTimePicker1.Width = 110
        Me.DateTimePicker1.Visible = True
        Me.DateTimePicker1.Tag = ColDate
        Me.DateTimePicker1.Format = DateTimePickerFormat.Short
        Me.DateTimePicker1.CustomFormat = ("dd/mm/yy")
        Me.DateTimePicker1.ShowCheckBox = False
        Me.DateTimePicker1.ShowUpDown = False
       
I use this control for date and time selection, in addition to the properties set above I would like the control to open and show the current mont view without the user having to click the down arrow on the control.

Regards,
Joe
0
 
zoofanCommented:
And what event to you want to use to trigger this? or do you want it to always stay open?

zf
0
 
JoeBo747Author Commented:
Hi zoofan,

The click event in ColDate that fires the other formats. When the user selects a date the calendar should close as normal.

regards,
Joe
0
 
zoofanCommented:
Looking to get it to open now

zf
0
 
Éric MoreauSenior .Net ConsultantCommented:
I use : SendKeys.Send("{F4}")
0
 
ethothsCommented:
Can you not simply call the ctrols client side click event when the page loads...

<script for="window" event="onload">
    mydropdowncontrol.click;
</script>

You will need to know the client side ID of your control though.
0
 
JoeBo747Author Commented:
Hi emoreau:,  zoofan:, ethoths:

I always feel a little guilty when awarding points when someone has been trying to help you with a problem and has possible put some time and thought into resolving your issues, but I suppose the rules are the rules! So on this occasion emoreau: must have the points, but I would like to thank zoofan for his efforts.

Me.DateTimePicker1.Select()
        SendKeys.Send("{F4}")

Gave me the result  I needed.

Regards,
Joe
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now