Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto open calendar in Date Time Picker
Message
 
À
23/06/2000 11:31:56
Tom Gahagan
Alliance Computer Solutions
Thomaston, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00383797
Message ID:
00384418
Vues:
31
>Is there a way to automaticaly drop down the calendar in that Date Time picker?
>
>I've tried useing keyboard (like you would in dropping down a combo box) and just can not get anything to work.
>
>Thanks for input!

I've been following this thread, wondering how you'd do something like this. I did a little digging and got it working. If you haven't figured it out for yourself yet, and still want to, you might want to stop reading now. Spoiler coming ;-)

In the GotFocus() method of the control add the following code:
#DEFINE WM_KEYDOWN  0x0100
#DEFINE VK_F4 0x73

hWnd = THISFORM.OleControl1.hWnd
=SendMessage(hWnd, WM_KEYDOWN, VK_F4, 0)
You'll also need to add the DEFINE somewhere for the SendMessage API call. I put it in my MAIN.PRG, but you can put it just about anywhere as long as it's set-up before it's used:
DECLARE INTEGER SendMessage IN WIN32API ;
   INTEGER hWnd, ;
   INTEGER Msg, ;
   INTEGER wParameter, ;
   INTEGER lParameter

What's a little non-obvious about the above is that hWnd is a hidden property of the control. I found lot's of threads about getting the window's Hwnd, not so many about getting a control's. After a little digging I found another thread that mentioned that little tidbit. I read (and reread) Ed & Mike's messages before figuring out the rest of it. HTH
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform