Detect Position in DateTimePicker

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In the top portion of the DateTimePicker, where the value of the date is
displayed, how can I detect whether the month or day or year is currently
focused, or, if ShowCheckBox = True, whether the checkbox is focused?
 
test selstart property against you format string

possibly work backwards cause monday is shorter than wednesday.
 
Actually, what I need to know is, in a DateTimePicker which has focus, and
has ShowCheckBox set to true, whether or not the CheckBox has focus. If it
does, the UP and DOWN arrow keys will be used as vertical tabs, sending
focus to the control immediately above or below the current DateTimePicker.
Otherwise, the UP and down arrows will be used for their normal function of
changing the portion of the date that has focus.

I have tried looping through the Controls property of the DateTimePicker,
but the internal controls do not belong to that collection.

Thanks for trying.
 
According to the MSDN help files, you can access the datetimepicker's
control collection as follows:

Me.DateTimePicker.Controls.Item(index).ContainsFocus()

You can use Me.DateTimePicker.Controls.Item(index).GetType() to check it's
type.

Dave
 
Back
Top