TextBox Click Event NOT Firing
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.mobile.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

George Papadopoulos via .NET 247 (VIP)
I'm doing Embedded Development using Visual C#, VS.NET 2003 & PPC 2003 SE Emulator. I have a TextBox Control and I want to change the BackColor of it when someone clicks on it. Apparently Windows Forms Designer doesn't have the Click Event on the list of events available on the Windows Forms Designer but you can generate it from within the Code Editor. The Code Editor gives you the "Click" property when you type "." after the TextBox's name and then, after you type "+=" it detects that you want to generate an event handler displays a tooltip suggesting the rest of the line as in "new EventHandler(textBoxSearch_Click); (Press TAB to insert)". When you do press TAB it generates the new "EventHandler..." line and highlights "textBoxSearch_Click" and gives you another "(Press TAB to insert)" tooltip which will generate the "textBoxSearch_Click" handler in the current Form class. I put my code in the handler but nothing happens when I click on it. I ran it through the debugger putting a breakpoint inside the handler and nothing at all!! The program behaves as if there is no click event handler on the TextBox. Note that all the other event handlers for my other controls on the form work fine. But those other event handlers where generated through the Windows Forms Designer. Any suggestions?? Ideas??

TIA
--------------------------------
From: George Papadopoulos

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>YSTK1QxRX0e7QQuvKoBXfw==</Id>
Reply to this message...
 
    
Andrew Enfield \(MS\) (VIP)
Try asking this on microsoft.public.dotnet.framework.compactframework. This
newsgroup is for ASP.NET mobile controls.

With that said, here's a possible solution: I'm not sure that the Click
event for textboxes is valid in the .NET CF, regardless of what Intellisense
says. There are plenty of events in the .NET CF that are, as I think I've
heard it put before, 'inherited but not implemented.' The Paul Yao and David
Durant book '.NET Compact Framework Programming with C#' (or VB) has a good
discussion of how and why this works the way it does.

--
Andrew Enfield
Programmer Writer, Windows CE

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

"George Papadopoulos via .NET 247" <Click here to reveal e-mail address> wrote in
message news:u7KYX%Click here to reveal e-mail address...
I'm doing Embedded Development using Visual C#, VS.NET 2003 & PPC 2003 SE
Emulator. I have a TextBox Control and I want to change the BackColor of it
when someone clicks on it. Apparently Windows Forms Designer doesn't have
the Click Event on the list of events available on the Windows Forms
Designer but you can generate it from within the Code Editor. The Code
Editor gives you the "Click" property when you type "." after the TextBox's
name and then, after you type "+=" it detects that you want to generate an
event handler displays a tooltip suggesting the rest of the line as in "new
EventHandler(textBoxSearch_Click); (Press TAB to insert)". When you do press
TAB it generates the new "EventHandler..." line and highlights
"textBoxSearch_Click" and gives you another "(Press TAB to insert)" tooltip
which will generate the "textBoxSearch_Click" handler in the current Form
class. I put my code in the handler but nothing happens when I click on it.
I ran it through the debugger putting a breakpoint inside the handler and
nothing at all!! The program behaves as if there is no click event handler
on the TextBox. Note that all the other event handlers for my other controls
on the form work fine. But those other event handlers where generated
through the Windows Forms Designer. Any suggestions?? Ideas??

TIA
--------------------------------
From: George Papadopoulos

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>YSTK1QxRX0e7QQuvKoBXfw==</Id>

Reply to this message...
 
 
System.EventHandler
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.TextBox




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com