Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. DateTimePicker

DateTimePicker

Scheduled Pinned Locked Moved Visual Basic
businesshelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nishkarsh_k
    wrote on last edited by
    #1

    I am using a datetimepicker in my VB 2005 express application I wan to Initialize the DTPicker as per the user input Restrict the min and max values as per user input Also keep on changing these settings in the application as user is allowed to change/edit input I tried using can any one please help me with it I had tried codes like the following DTPk_reg_day.Value = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1) is there any provision of NULL value?? DTPk_reg_day.MinDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1) DTPk_reg_day.MaxDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, DTPk_reg_day.Value.MaxValue.Day) But i am mot successful in achieving all the requirements at the same time Is there any ways i can also have a NULL value

    C V 2 Replies Last reply
    0
    • N nishkarsh_k

      I am using a datetimepicker in my VB 2005 express application I wan to Initialize the DTPicker as per the user input Restrict the min and max values as per user input Also keep on changing these settings in the application as user is allowed to change/edit input I tried using can any one please help me with it I had tried codes like the following DTPk_reg_day.Value = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1) is there any provision of NULL value?? DTPk_reg_day.MinDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1) DTPk_reg_day.MaxDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, DTPk_reg_day.Value.MaxValue.Day) But i am mot successful in achieving all the requirements at the same time Is there any ways i can also have a NULL value

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      nishkarsh_k wrote:

      Is there any ways i can also have a NULL value

      No. A Datetime cannot be null, nor can any of it's parameters.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • N nishkarsh_k

        I am using a datetimepicker in my VB 2005 express application I wan to Initialize the DTPicker as per the user input Restrict the min and max values as per user input Also keep on changing these settings in the application as user is allowed to change/edit input I tried using can any one please help me with it I had tried codes like the following DTPk_reg_day.Value = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1) is there any provision of NULL value?? DTPk_reg_day.MinDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1) DTPk_reg_day.MaxDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, DTPk_reg_day.Value.MaxValue.Day) But i am mot successful in achieving all the requirements at the same time Is there any ways i can also have a NULL value

        V Offline
        V Offline
        visualhint
        wrote on last edited by
        #3

        Hi, The Microsoft DateTimePicker must be given a value type (a DateTime) and therefore can't accept null values. There are a lot of more or less usable solutions to solve this issue, some can be found here on CodeProject. If a commercial solution is an option, I would recommend Smart FieldPackEditor.Net which has been built from the ground up to solve all the DateTimePicker shortcomings.

        Best regards, Nicolas Cadilhac @ VisualHint Smart PropertyGrid.Net Microsoft PropertyGrid Resource List Free PropertyGrid for MFC Smart FieldPackEditor.Net / DateTimePicker

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups