Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

Dynamically Added Textbox (no KeyDown, KeyUp, KeyPress events fire)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Doug  Perkes - 20 Jan 2005 16:14 GMT
I am having a strange problem with a textbox that I am dynamically
adding to a form.

What I am currently doing
-------------------------
I have a set of questions defined in a database. Each question can have
a variable number of possible responses and can be laid out
differently.

I have an answer factory class that gets the correct answer control
(RadioButton, TextBox, CheckBox) and provides it to a question control.
The question control then adds the answer to one of its panels. All
this seems to work a designed...I can add any number of questions and
answers to a question list control in a variety of different layouts.

The Problem I am Encountering
-------------------------
The problem occurs with textbox controls. They display correctly,
however, the KeyDown, KeyUp, and KeyPress events are not firing for the
textboxes (in other words, I can't type anything into the textbox).

However, if I have 2 textbox controls in the same container (panel), I
can always get the KeyUp, KeyPress, and KeyDown events to fire by
tabbing from the first textbox to the second. Once I do this, I can
then start typing into both textboxes without problem.
I am completely stumped.

Thanks for your help,

Doug
Doug  Perkes - 20 Jan 2005 21:59 GMT
Well, I haven't been able to recreate the problem in another app but I
have discovered one more thing: if I use the TAB key to navigate to
the textboxes from other controls, the textbox behaves normally.
However, if I use the mouse to click in the textbox the KeyUp,
KeyDown, etc events do not fire.

This is a strange one.

--
Doug

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.