Solved

Calendar - Select a period

Posted on 2003-10-22
7
340 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
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 500 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now