Results 1 to 7 of 7

Thread: dtpicker.locked = i wish...

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Buffalo, NY
    Posts
    8

    Exclamation

    iv'e recently come accross a minor hurdle in a fairly large application in which the deadline for the testing phase in nearing....anyway, the problem.. the ever buggy datetime picker control has no locked property, to many pitfalls in trying to capture keystrokes considering all of the users are keyboard guru's. Does anyone know of a better way in locking the datetime picker? (subclassing??) Seems like a fairly fundamental question yet im stumped... Another issue with same question being the ever so common listbox, another control in which there is no locked property.. oh ya, and if you reply with "just disable it" that wont do.. I need a disabled "scrollable" listbox, disabling completely hinders the control of any user interaction... thanks in advance..
    green is good..

  2. #2
    Hyperactive Member D12Bit's Avatar
    Join Date
    Oct 2000
    Location
    Guatemala
    Posts
    373

    Question Feed me please

    hello,

    What do you want the DTPicker for in your app?

    To show a date or to limit the date in a range to pick?

    Saludos...
    "Who Dares Wins" - "Quien se Arriesga Gana"
    Mail me at:

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Buffalo, NY
    Posts
    8
    For choosing a date. For instance Date Of Birth: <dtpicker>. I then send the value to a sql backend, i have to use a dtpicker as per users requests...
    green is good..

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    If I understand you correctly you don't want the user to be able to use the keyboard to change a date or time in the DTPicker but still be able to use the dropdown or the updown buttons.
    Is this correct? In that case simply add the following code line in the KeyDown event:
    Code:
    Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
        KeyCode = 0
    End Sub
    Best regards

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Buffalo, NY
    Posts
    8
    Yes, i do not want the user to change it with the keyboard or the mouse, and prevent the date time picker from dropping down. Pretty much acting like it is locked.
    Thanks for your response
    green is good..

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Well in that case you have two choises.
    Either simply set the Enabled property to False.
    If you don't like that put the DTPicker in a borderless picture box that is sized to the same size as the DTPicker and the set the Enabled property for the PictureBox to false.

    Best regards

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Buffalo, NY
    Posts
    8

    Wink

    Ahh, good thinking. I completely forgot about the old use a container trick. That works great! thanks again
    green is good..

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