[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1085
  • Last Modified:

displaying and selecting calendar date from dropdown textbox

there is anywhere, while developing on vb6, i can program two textboxes, one: is STARTING DATE, another one: ENDING DATE,  such that, instead of keying date in box, i can click inside the textbox or combox, browse and select a particular date i want. any comment or suggestion would be appreciated
0
winklez
Asked:
winklez
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
GrahamSkanRetiredCommented:
Have you tried the DatePicker (DtPicker) control?
You could use two of them instead of textboxes.
0
 
GrahamSkanRetiredCommented:
Note. If the date picker is not in your toolbox, add the 'Microsoft Windows Common Controls-2 6.0' set via Project/Components.
0
 
23637269Commented:
DtPicker is what I normally used.
If you have a restriction that prevents you from using that you could create a picturebox and add an array of smaller pictureboxes inside to represent a Day Squares.  You can insert text within each square for the day's info.  The mouse click within the square would let you know what the user picked.

The DtPicker that Graham Skan suggested would be much easier.
You know what they say, why reinvent the wheel :)

Thanks
Roger
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
dentabCommented:
I would use the date picker although I have created my own in the past.

If you dont want to have the common controls dependancy, try this:
http://ccrp.mvps.org/controls/ccrpdtp6.htm
0
 
winklezAuthor Commented:
then how do u set the dtpicker to today date ? otherwise, how can u make the dtpicker to open up the current month calender and i choose myself the right date? ; the here the dtpicker is loading the 30 jan 2006 as the default date  however it could be more easier for me, if loaded with today date.
thanks for endless support
0
 
GrahamSkanRetiredCommented:
Set the value in the Form load event
Private Sub Form_Load()
    DTPicker1.Value = Now
End Sub

Open in new window

0
 
dentabCommented:
you need on form load to set the date property to equal now...

e.g.

  DTPicker1.Value = Now
0
 
dentabCommented:
doh, 1 min beffore me :)
0
 
dentabCommented:
Then all I can suggest is that if the end-date is usually a set time away, then you could also set that

e.g.

Private Sub Form_Load()
  DTPicker1.Value = Now
  DTPicker2.Value = DateAdd("D", 7, Now)
End Sub

0
 
winklezAuthor Commented:
thanks 4 ur excellent work! keep it up
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

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