-
Drop down a DTPicker from code?
Is there a method to drop down a DateTime Picker from code?
I assume that it'll be a SendMessage call, but I have no idea what message
to send. Any help would be appreciated.
Thanks,
Dave
-
Re: Drop down a DTPicker from code?
On Fri, 24 Nov 2000 11:40:50 -0500, "David Crowell"
<dc_work@yahoo.com> wrote:
>Is there a method to drop down a DateTime Picker from code?...
Unfortunately, no direct way. However it's fairly simple to fake a
mouse click on the dropdown arrow button with mouse_event.
-Tom
(please post replies to the newsgroup)
-
Re: Drop down a DTPicker from code?
On Fri, 24 Nov 2000 11:40:50 -0500, "David Crowell"
<dc_work@yahoo.com> wrote:
>Is there a method to drop down a DateTime Picker from code?...
Unfortunately, no direct way. However it's fairly simple to fake a
mouse click on the dropdown arrow button with mouse_event.
-Tom
(please post replies to the newsgroup)
-
Re: Drop down a DTPicker from code?
Using SPY++ I found that the DTP does not have a child buttion, but I was
able to get this to work with the following kludge...
Option Explicit
Private Const WM_LBUTTONDOWN As Long = &H201
Private Const WM_LBUTTONUP As Long = &H202
Private Const MK_LBUTTON = &H1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
Public Sub DropDTPicker(dtp As Object)
Dim Pos As Long
Pos = ((dtp.Width / Screen.TwipsPerPixelX) - 5) Or &H50000
SendMessage dtp.hwnd, WM_LBUTTONDOWN, MK_LBUTTON, ByVal Pos
SendMessage dtp.hwnd, WM_LBUTTONUP, MK_LBUTTON, ByVal Pos
End Sub
Dave
www.davidcrowell.com
"Tom Esh" <tjeshGibberish@blazenet.net> wrote in message
news:3a1ebc97.35338118@news.devx.com...
> On Fri, 24 Nov 2000 11:40:50 -0500, "David Crowell"
> <dc_work@yahoo.com> wrote:
> >Is there a method to drop down a DateTime Picker from code?...
>
> Unfortunately, no direct way. However it's fairly simple to fake a
> mouse click on the dropdown arrow button with mouse_event.
>
>
> -Tom
> (please post replies to the newsgroup)
-
Re: Drop down a DTPicker from code?
Using SPY++ I found that the DTP does not have a child buttion, but I was
able to get this to work with the following kludge...
Option Explicit
Private Const WM_LBUTTONDOWN As Long = &H201
Private Const WM_LBUTTONUP As Long = &H202
Private Const MK_LBUTTON = &H1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
Public Sub DropDTPicker(dtp As Object)
Dim Pos As Long
Pos = ((dtp.Width / Screen.TwipsPerPixelX) - 5) Or &H50000
SendMessage dtp.hwnd, WM_LBUTTONDOWN, MK_LBUTTON, ByVal Pos
SendMessage dtp.hwnd, WM_LBUTTONUP, MK_LBUTTON, ByVal Pos
End Sub
Dave
www.davidcrowell.com
"Tom Esh" <tjeshGibberish@blazenet.net> wrote in message
news:3a1ebc97.35338118@news.devx.com...
> On Fri, 24 Nov 2000 11:40:50 -0500, "David Crowell"
> <dc_work@yahoo.com> wrote:
> >Is there a method to drop down a DateTime Picker from code?...
>
> Unfortunately, no direct way. However it's fairly simple to fake a
> mouse click on the dropdown arrow button with mouse_event.
>
>
> -Tom
> (please post replies to the newsgroup)
-
Re: Drop down a DTPicker from code?
Hi Dave --
> Is there a method to drop down a DateTime Picker from code?
SendKeys "{F4}" (or equivalent WM_KEYDOWN/WM_KEYUP messages).
Later... Karl
--
http://www.mvps.org/vb
-
Re: Drop down a DTPicker from code?
Hi Dave --
> Is there a method to drop down a DateTime Picker from code?
SendKeys "{F4}" (or equivalent WM_KEYDOWN/WM_KEYUP messages).
Later... Karl
--
http://www.mvps.org/vb
-
Re: Drop down a DTPicker from code?
I had no idea that F4 would drop down a DTPicker... who thought of that
one... 
Dave
"Karl E. Peterson" <karl@mvps.org> wrote in message
news:3a31838c$1@news.devx.com...
> Hi Dave --
>
> > Is there a method to drop down a DateTime Picker from code?
>
> SendKeys "{F4}" (or equivalent WM_KEYDOWN/WM_KEYUP messages).
>
> Later... Karl
> --
> http://www.mvps.org/vb
>
>
>
-
Re: Drop down a DTPicker from code?
I had no idea that F4 would drop down a DTPicker... who thought of that
one... 
Dave
"Karl E. Peterson" <karl@mvps.org> wrote in message
news:3a31838c$1@news.devx.com...
> Hi Dave --
>
> > Is there a method to drop down a DateTime Picker from code?
>
> SendKeys "{F4}" (or equivalent WM_KEYDOWN/WM_KEYUP messages).
>
> Later... Karl
> --
> http://www.mvps.org/vb
>
>
>
-
Re: Drop down a DTPicker from code?
I was *really* pissed, myself, one day a few years ago, and just kept banging on keys
until something worked. <g>
--
http://www.mvps.org/vb
"David Crowell" <dave@davidcrowell.com> wrote in message
news:3a318b6e@news.devx.com...
> I had no idea that F4 would drop down a DTPicker... who thought of that
> one... 
>
> Dave
>
> "Karl E. Peterson" <karl@mvps.org> wrote in message
> news:3a31838c$1@news.devx.com...
> > Hi Dave --
> >
> > > Is there a method to drop down a DateTime Picker from code?
> >
> > SendKeys "{F4}" (or equivalent WM_KEYDOWN/WM_KEYUP messages).
> >
> > Later... Karl
> > --
> > http://www.mvps.org/vb
> >
> >
> >
>
>
-
Re: Drop down a DTPicker from code?
I was *really* pissed, myself, one day a few years ago, and just kept banging on keys
until something worked. <g>
--
http://www.mvps.org/vb
"David Crowell" <dave@davidcrowell.com> wrote in message
news:3a318b6e@news.devx.com...
> I had no idea that F4 would drop down a DTPicker... who thought of that
> one... 
>
> Dave
>
> "Karl E. Peterson" <karl@mvps.org> wrote in message
> news:3a31838c$1@news.devx.com...
> > Hi Dave --
> >
> > > Is there a method to drop down a DateTime Picker from code?
> >
> > SendKeys "{F4}" (or equivalent WM_KEYDOWN/WM_KEYUP messages).
> >
> > Later... Karl
> > --
> > http://www.mvps.org/vb
> >
> >
> >
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks