|
-
Jul 20th, 2004, 09:34 PM
#1
Thread Starter
Addicted Member
need help badly!
Currently I am facing a problem.
I'm trying to create an application using calendar for booking purposes. I want to limit the calendar to like 7days for now.
E.g.
Private Sub DatePicker1_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DatePicker1.Change
DatePicker1.MinDate = DateTime.Today
DatePicker1.MaxDate = Now.AddDays(7)
End Sub
Now, when the DatePicker1 is limited to 7days, I want to click it so that it will bring me to let say Form2. But now, I click on the other dates, it will bring me to Form2, but I want to limit Form2 for that just 7days.
Is there any idea I can disable other days?
Any advice would be glady appreciated.
Last edited by hhh; Jul 20th, 2004 at 11:42 PM.
-
Jul 21st, 2004, 11:44 AM
#2
You should set the min and max values before this is ever called. Unless you have other code, what you have added will let the user pick anyvalue the first time then limit them the next time.
Move that min and max to form load or something similar.
As to your question do you mean that when a user clicks the control, you only want it to open Form2, if the date is within the 7 days you have already suggested ?
If so, just check the date of the control before you open form2 (im sure you have code that does this already) and check the the data is greater then today and less then 7 days from today. If it does not meet this critera, you dont open form2.
-
Jul 21st, 2004, 12:00 PM
#3
Hyperactive Member
Why post this twice mate!?
"I'm Brian and so is my Wife"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|