Detect Position in DateTimePicker

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?
 
J

Jared

test selstart property against you format string

possibly work backwards cause monday is shorter than wednesday.
 
G

Guest

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.
 
D

David Lee Conley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top