Solved

Calendar - Select a period

Posted on 2003-10-22
7
370 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 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

729 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