Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop down date picker programtically 1

Status
Not open for further replies.

TimBiesiek

Programmer
Nov 3, 2004
151
AU
Hi All,

Am trying to drop down a date picker control when the user clicks on a certain button.

Have done this with combo boxes (Simply by 'comboboxname.droppeddown = true'), but there appears to be no simple way to do this for a date picker...

Anyone got any ideas??
 
doesnt it have a style called dropdown and cant u set it on the click?
 
Ummmmm, maybe....

Can you give me an example how?
 
Although the use of SendKeys is frowned on this works - and I can't think of any other straightforward solution...

Code:
  Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    DateTimePicker1.Focus()
    SendKeys.Send("%{DOWN}")

  End Sub


Hope this helps.

[vampire][bat]
 
chmohan - Nope, that link didn't tell me anymore than I already know sorry...

earthandfire - That may have to do for now, until such a time that I can find another way around it...

Thanks to both of you!
 
Tim, the only other way would be to create your own control inheriting form the DateTimePicker and providing the functionality yourself, which is why I said that I couldn't think of any other straightforward solution.

[vampire][bat]
 
Hmmm, ok, thanks.

Haven't got the time to create my own control at the mo, so sendkeys will just have to do!

Thanks a ton!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top