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. C / C++ / MFC
  4. disable/grey out date time picker

disable/grey out date time picker

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 Posters 1 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.
  • V Offline
    V Offline
    viperlogic
    wrote on last edited by
    #1

    i was wondering how do you grey-out / disable the date time picker, is there a flag that can be changed say using a send message? i have my date time picker as a CDateTimeCtrl type

    R D 2 Replies Last reply
    0
    • V viperlogic

      i was wondering how do you grey-out / disable the date time picker, is there a flag that can be changed say using a send message? i have my date time picker as a CDateTimeCtrl type

      D Offline
      D Offline
      Dy
      wrote on last edited by
      #2

      Disable:

      CDateTimeCtrl yourCtrl;
      yourCtrl.EnableWindow(FALSE);

      Enable:

      CDateTimeCtrl yourCtrl;
      yourCtrl.EnableWindow(TRUE); // sorry, this said FALSE before, should have read TRUE

      CDateTimeCtrl derives from CWnd, which exposes the EnableWindow function, hence you can use EnableWindow on all CWnd derived objects


      - Dy -- modified at 9:45 Tuesday 11th April, 2006

      1 Reply Last reply
      0
      • V viperlogic

        i was wondering how do you grey-out / disable the date time picker, is there a flag that can be changed say using a send message? i have my date time picker as a CDateTimeCtrl type

        R Offline
        R Offline
        RickyC
        wrote on last edited by
        #3

        Did you try this?

        GetDlgItem(IDC_YOUR_DATE_TIME_PICKER)->EnableWindow(FALSE);

        regards!

        V 1 Reply Last reply
        0
        • R RickyC

          Did you try this?

          GetDlgItem(IDC_YOUR_DATE_TIME_PICKER)->EnableWindow(FALSE);

          regards!

          V Offline
          V Offline
          viperlogic
          wrote on last edited by
          #4

          thanks all, enablewindow works perfect, dont know why i didnt think of that!! i was trying to the the EN_******** to use with a sendmessage!!

          T 1 Reply Last reply
          0
          • V viperlogic

            thanks all, enablewindow works perfect, dont know why i didnt think of that!! i was trying to the the EN_******** to use with a sendmessage!!

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            EN_******** messages are for EditBoxes controls ;)

            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