Results 1 to 3 of 3

Thread: need help badly!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Posts
    235

    Thumbs up 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.

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    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.

  3. #3
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307
    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
  •  



Click Here to Expand Forum to Full Width