Date Time Picker Control Question

  • Thread starter Alastair MacFarlane
  • Start date
A

Alastair MacFarlane

Dear All,

I have added a Date Time Picker date control to a project (in fact it is
displayed when I select a specific column in a datagrid) and I would like it
to expand when it receives the focus. The code below works for a ComboBox
(substituting the hWnd value) but it does not work work with the Date Time
Picker control. Does anyone have any ideas?

Private Sub DTPicker1_GotFocus()
Call SendMessage(DTPicker1.hWnd, CB_SHOWDROPDOWN, True, 0&)
End Sub

The event gets fired as expected but the code does not have the desired
effect.

Thanks again.

Alastair MacFarlane

p.s The code that positions the DTPicker is as follows:

Dim gridCol As MSDataGridLib.Column
Set gridCol = grdDataGrid.Columns(grdDataGrid.Col)
DTPicker1.Move grdDataGrid.Left + gridCol.Left, grdDataGrid.Top +
grdDataGrid.RowTop(grdDataGrid.Row), gridCol.Width
DTPicker1.ZOrder
DTPicker1.Visible = True
DTPicker1.SetFocus
DTPicker1.Value = gridCol.Text
 

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