-
Capturing ESC key in DataReport Window
Hello,
A friend wants to be able to press ESC in a DataReport window and have the
window close. I'm not finding any events/properties within the DataReport
to help with this like you can in a Form_KeyDown event. I know the
DataReport is very limited. Still maybe there is an API way of solving the
problem.
Any suggestions?
Thanks,
Jeff Ross
-
Re: Capturing ESC key in DataReport Window
One easy way would be to add a "Close" button and set its .Cancel property
to True. In the click event you just Hide or Unload the form.
--
Michael Shutt
Please respond to newsgroup as I will not return direct emails.
"Jeff Ross" <jeffkross@yahoo.com> wrote in message
news:3b26ca3e$1@news.devx.com...
> Hello,
>
> A friend wants to be able to press ESC in a DataReport window and have the
> window close. I'm not finding any events/properties within the DataReport
> to help with this like you can in a Form_KeyDown event. I know the
> DataReport is very limited. Still maybe there is an API way of solving
the
> problem.
>
> Any suggestions?
>
> Thanks,
> Jeff Ross
>
>
-
Re: Capturing ESC key in DataReport Window
One easy way would be to add a "Close" button and set its .Cancel property
to True. In the click event you just Hide or Unload the form.
--
Michael Shutt
Please respond to newsgroup as I will not return direct emails.
"Jeff Ross" <jeffkross@yahoo.com> wrote in message
news:3b26ca3e$1@news.devx.com...
> Hello,
>
> A friend wants to be able to press ESC in a DataReport window and have the
> window close. I'm not finding any events/properties within the DataReport
> to help with this like you can in a Form_KeyDown event. I know the
> DataReport is very limited. Still maybe there is an API way of solving
the
> problem.
>
> Any suggestions?
>
> Thanks,
> Jeff Ross
>
>
-
Re: Capturing ESC key in DataReport Window
I'm not wanting to hide or close a form, but a datareport window. The
standard controls such as command buttons are not available to add to a
datareport window.
Jeff
Michael Shutt wrote in message <3b274a85@news.devx.com>...
>One easy way would be to add a "Close" button and set its .Cancel property
>to True. In the click event you just Hide or Unload the form.
>
>--
>Michael Shutt
>
>Please respond to newsgroup as I will not return direct emails.
>
-
Re: Capturing ESC key in DataReport Window
I'm not wanting to hide or close a form, but a datareport window. The
standard controls such as command buttons are not available to add to a
datareport window.
Jeff
Michael Shutt wrote in message <3b274a85@news.devx.com>...
>One easy way would be to add a "Close" button and set its .Cancel property
>to True. In the click event you just Hide or Unload the form.
>
>--
>Michael Shutt
>
>Please respond to newsgroup as I will not return direct emails.
>
-
Re: Capturing ESC key in DataReport Window
Use getkeystate and check if the escape key is pressed
put the following into a module
Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Integer
then put the following into your source
If GetKeyState(vbKeyEscape) = 1 Then
'Add code for the closing of it
End If
This will check if the escape key is pressed, then you just have to check
wether the DataReport window has focus and if it does, close it. You may
have some problems with if getkeystate = 1 might want the opposite number.
Eg: if the key is pressed the first time it changes to 1, then the second it
changes to 0, and so on. If you have this problem, email me, i've got some
code to fix it somewhere.
James Abbott
Jeff Ross <jeffkross@yahoo.com> wrote in message
news:3b26ca3e$1@news.devx.com...
> Hello,
>
> A friend wants to be able to press ESC in a DataReport window and have the
> window close. I'm not finding any events/properties within the DataReport
> to help with this like you can in a Form_KeyDown event. I know the
> DataReport is very limited. Still maybe there is an API way of solving
the
> problem.
>
> Any suggestions?
>
> Thanks,
> Jeff Ross
>
>
-
Re: Capturing ESC key in DataReport Window
Use getkeystate and check if the escape key is pressed
put the following into a module
Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Integer
then put the following into your source
If GetKeyState(vbKeyEscape) = 1 Then
'Add code for the closing of it
End If
This will check if the escape key is pressed, then you just have to check
wether the DataReport window has focus and if it does, close it. You may
have some problems with if getkeystate = 1 might want the opposite number.
Eg: if the key is pressed the first time it changes to 1, then the second it
changes to 0, and so on. If you have this problem, email me, i've got some
code to fix it somewhere.
James Abbott
Jeff Ross <jeffkross@yahoo.com> wrote in message
news:3b26ca3e$1@news.devx.com...
> Hello,
>
> A friend wants to be able to press ESC in a DataReport window and have the
> window close. I'm not finding any events/properties within the DataReport
> to help with this like you can in a Form_KeyDown event. I know the
> DataReport is very limited. Still maybe there is an API way of solving
the
> problem.
>
> Any suggestions?
>
> Thanks,
> Jeff Ross
>
>
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