Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calendar - Select a period

Posted on 2003-10-22
7
Medium Priority
?
380 Views
Last Modified: 2010-05-01
I'd like to select not just a day but a period with calendar (multiple days)
Does anyone know a way to do that?
0
Comment
Question by:meciab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:Eddiebaby
ID: 9598728
I don't think that you can do this with just one calendar control.

The best thing to do is to have two calendar controls, with the user selecting the from date in the first box and the to date in the second.

Add validation code to ensure that the date range is valid - e.g that the first date is older than the second.

Ed
0
 

Author Comment

by:meciab
ID: 9598784
Yes I ever user this solution but it doesn't fit with my needs cos' I want for exemple select monday an wedneday of two weeks.
0
 
LVL 39

Accepted Solution

by:
appari earned 1500 total points
ID: 9598794
you can use monthview control
in vb ide press CTRL+T select  microsoft windows common controls-2 6.0. you can see monthview control.
set MultiSelect property to true.
set MaxSelCount tono of days you want to allow to select.

from selection

MsgBox MonthView1.SelStart    returns start day selected
MsgBox MonthView1.SelEnd      returns end day selected
 
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:meciab
ID: 9599218
Thanks but even with multiselect property you can't select (even with ctrl) for exemple the 1,4,13,19 and 28 of the month.
And if you display 3 months you can't select a period on this 3 months you can just select a period on the same month.
0
 

Author Comment

by:meciab
ID: 9599417
...oupss sorry you can select a continuous period on 3 months. But you can't select a discontinuous period
0
 

Expert Comment

by:eliaslopezgtz
ID: 9601156
you can create a custom control that loads calendar controls at run time... and get the intervals you need.
0
 
LVL 5

Expert Comment

by:JCinDE
ID: 9601862
Use a listbox to display selected dates and a DatePicker control to add new ones. It's not as pretty as having the calendar highlight all the days, but it's functional.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question