Textbox Click, KeyUp events

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I'm having trouble getting code to run in response to the user tapping on a
textbox. It looks like the Click event of the Textbox is not implemented in
the .NET CF? How about KeyUp? I have MsgBox() calls in each event and they
are not showing when I tap on the textbox.
 
The click event is not available in a TextBox, however, KeyUp, KeyPress and
KeyDown events are available. The key events are not generated when tapping
the textbox, but on entering data using the keyboard / SIP. To make sure:
Have you installed the .NET CF SP2?
 
Hi Mike,

The click event is not supported for textboxes...but you should have all
key events (keydown, keypress, keyup).

What are you trying to do in the click event - would the 'GotFocus' event
work?

-Katie

This posting is provided "AS IS" with no warranties, and confers no rights.

***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts: http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp

--------------------
| From: "Mike" <[email protected]>
| Subject: Textbox Click, KeyUp events
| Date: Tue, 6 Jan 2004 16:35:44 -0500
| Lines: 6
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: adsl-068-016-172-251.sip.mco.bellsouth.net
68.16.172.251
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.
phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:42299
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I'm having trouble getting code to run in response to the user tapping on
a
| textbox. It looks like the Click event of the Textbox is not implemented
in
| the .NET CF? How about KeyUp? I have MsgBox() calls in each event and
they
| are not showing when I tap on the textbox.
|
|
|
 
The click event is not available in a TextBox, however

Is there a way to subclass controls with the CF? I read an article about
subclassing in VB6, but I'm not sure, if it can be ported to the ppc due
API-calls (DLLImport)?
Maybe there's an example somewhere?

Thanks, D.Barisch
 
Hi Daniel,

There's not really an easy way to get this event for textboxes under
..NetCF. The easiest thing to do would be to write a custom control
(basically inherits from 'Control', which does support Click events).
What's the scenario you're trying to accomplish - maybe I can suggest
another workaround or event for you to use?

-Katie

This posting is provided "AS IS" with no warranties, and confers no rights.

***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts: http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp

--------------------
| From: <Daniel Barisch>
| References: <[email protected]>
<eT#[email protected]>
| Subject: Re: Textbox Click, KeyUp events
| Date: Wed, 7 Jan 2004 09:07:30 +0100
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: pd9ee7e60.dip.t-dialin.net 217.238.126.96
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:42332
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| > The click event is not available in a TextBox, however
|
| Is there a way to subclass controls with the CF? I read an article about
| subclassing in VB6, but I'm not sure, if it can be ported to the ppc due
| API-calls (DLLImport)?
| Maybe there's an example somewhere?
|
| Thanks, D.Barisch
|
|
|
 
Hello Katie!

Thank you for your reply!
There's not really an easy way to get this event for textboxes under
NetCF. The easiest thing to do would be to write a custom control
(basically inherits from 'Control', which does support Click events).
What's the scenario you're trying to accomplish - maybe I can suggest
another workaround or event for you to use?

It wasn't really the TextBox-Click-Event I was interested in...
I've another problem, that I've posted some weeks ago. But I haven't got any
answer, wether in this ng, nor in an other one. But because I'm still
looking for a solution I'll repeat...

====
In the Popup-eventhandler of a ContextMenu I need to get the position where
the stylus hits the control to call the ContextMenu.

Asking the MousePosition-Property in ContextMenu.Popup returns the expected
values on the emulator, but there's a strange behavior on my device (iPAQ
3850 (ARM)):
The Control.MousePosition contains the point, where you last clicked (just
clicked, no ContextMenu) the 'clear' form (where is no control under the
stylus and what perhaps has been some ContextMenus ago).

Why does it work in the emulator, but not on my device?

So how to get the point? You can't even save the position in MouseDown,
because it is not fired, if the ContextMenu is called. Or is there a way to
force the control to fire MouseDown before the ContextMenu pops up?
====

Do you have any suggestion? I thougth subclassing would be a (very hard but)
possible solution...

Thanks, D.Barisch
 
Yes, GotFocus() works, thanks. Since Click() is not available, shouldn't
Click() not be in the drop-down list on the right side at the top of the VB
..NET code window when a textbox is selected on the left side?
 
Hi Daniel,

The best way I can think of to help you is to tell you a bit more about
what happens for Control.MousePosition. When this is called, we first try
a 'GetCursorPos' API call. If this succeeds (returns non-zero), we convert
that point to client coordinates and return it.
If that API fails (returns non-zero), we return an internally cached point
containing the last mouse position given by mousemoves. (I believe this
may have been the bug you were running into - we now update that cache
position for mousedown, move, and mouseup). Unfortunately this isn't fixed
for our service paks, so it may be a while before I can get it into your
hands.

There is, however, some hope...check out this article by one of our MVPs:
http://blog.opennetcf.org/afeinman/PermaLink.aspx/82242aee-5711-4c6d-b9e2-3d
3cd6610b5d
He shows an example intercepting the WM_HELP message - purhaps you can get
this to work for you with the WM_CONTEXTMENU or WM_LBUTTONDOWN messages.

Please let me know if you make any progress with this.
-Katie

This posting is provided "AS IS" with no warranties, and confers no rights.

***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts: http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp

--------------------
| From: <Daniel Barisch>
| References: <[email protected]>
<eT#[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Textbox Click, KeyUp events
| Date: Wed, 7 Jan 2004 11:58:44 +0100
| Lines: 40
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: pd953ee76.dip.t-dialin.net 217.83.238.118
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:42344
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hello Katie!
|
| Thank you for your reply!
|
| > There's not really an easy way to get this event for textboxes under
| > NetCF. The easiest thing to do would be to write a custom control
| > (basically inherits from 'Control', which does support Click events).
| > What's the scenario you're trying to accomplish - maybe I can suggest
| > another workaround or event for you to use?
|
| It wasn't really the TextBox-Click-Event I was interested in...
| I've another problem, that I've posted some weeks ago. But I haven't got
any
| answer, wether in this ng, nor in an other one. But because I'm still
| looking for a solution I'll repeat...
|
| ====
| In the Popup-eventhandler of a ContextMenu I need to get the position
where
| the stylus hits the control to call the ContextMenu.
|
| Asking the MousePosition-Property in ContextMenu.Popup returns the
expected
| values on the emulator, but there's a strange behavior on my device (iPAQ
| 3850 (ARM)):
| The Control.MousePosition contains the point, where you last clicked (just
| clicked, no ContextMenu) the 'clear' form (where is no control under the
| stylus and what perhaps has been some ContextMenus ago).
|
| Why does it work in the emulator, but not on my device?
|
| So how to get the point? You can't even save the position in MouseDown,
| because it is not fired, if the ContextMenu is called. Or is there a way
to
| force the control to fire MouseDown before the ContextMenu pops up?
| ====
|
| Do you have any suggestion? I thougth subclassing would be a (very hard
but)
| possible solution...
|
| Thanks, D.Barisch
|
|
|
|
 
Hello Katie!

Thank you for your help and to let me understand, what's happening 'inside'.
Please let me know if you make any progress with this.

OK, I'll do, but it will take some days...

D.Barisch
 
Back
Top