.NETGURU
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 Guru (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 Guru (http://www.dot-net-guru.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 Guru" <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 Guru (http://www.dot-net-guru.com/)

<Id>YSTK1QxRX0e7QQuvKoBXfw==</Id>

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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification