Click here to Skip to main content
15,897,518 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Implementing a Read-Only 'File Open' or 'File Save' Common Dialog Pin
Mike Ellison29-Jul-09 5:42
Mike Ellison29-Jul-09 5:42 
QuestionAttractive programs that use Windows Forms to build their GUI Pin
copec25-Jul-09 18:48
copec25-Jul-09 18:48 
QuestionMake Dialer Pin
Any_India25-Jul-09 2:01
Any_India25-Jul-09 2:01 
Questioncan dragdrop in a listview? Pin
neodeaths24-Jul-09 19:10
neodeaths24-Jul-09 19:10 
AnswerRe: can dragdrop in a listview? Pin
Mike Ellison27-Jul-09 2:28
Mike Ellison27-Jul-09 2:28 
QuestionEvent Driven Form Pin
teknozwizard24-Jul-09 16:43
teknozwizard24-Jul-09 16:43 
AnswerRe: Event Driven Form Pin
Mycroft Holmes24-Jul-09 17:56
professionalMycroft Holmes24-Jul-09 17:56 
AnswerRe: Event Driven Form [modified] Pin
BillWoodruff24-Jul-09 22:13
professionalBillWoodruff24-Jul-09 22:13 
Hi Teknowizard,

I am going to take your "ui" description literally and assume you really want to display a single question at a time, and I'm going to assume that you intend for the question to be displayed in the main area of the form (i.e., independently of the textbox docked to the bottom). Please correct me if that interpretation is not right.

So you have some method of showing one-question-a-time (textbox ?).

Maybe you have a timer controlling how long the question is visible ... whatever.

Now the user is typing their answer in the textbox : you are going to monitor the user's actions in the TextBox and at some point change the question.

There are many ways to do this, and I'll give you a few hints about design choices you can make with your user input textbox :

1. Multiline property of TextBox : will it be single-line or multi-line

2. AcceptsReturn property of TextBox : what will happen when the user hits the Enter key ?

3. AcceptsTab property of TextBox : what if the use enters tab ?

4. WordWrap property of the TextBox : if multi-line do you want to allow wrapping ?

Once you have experimented with and familiarized yourself with these properties, you can move on to Events of the TextBox.

Note that you could, by setting KeyPreview property of the hosting Form to true, handle key down/up/press events at the Form level.

I suggest you examine the following Events :

1. KeyDown

2. KeyUp

3. KeyPress

And consider the issue of what if the user clicks outside the TextBox : do you wish to make the Focus be restrained so the only thing the user can do is type in the TextBox : examine Events :

1. Enter

2. Leave

If you wish the user to "signal" when they are done entering an answer by some keyboard activity, you are going to need to write a Key Event Handler : start writing one now, and mess around with it, get familiar with KeyCode and/or KeyData properties of the EventArgs passed to a Key Event.

If you wish the user to "signal" they are done by some other means, well, up to you.

A few hours now of experimenting will pay big dividends for you in the future.

best, Bill

"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844

modified on Saturday, July 25, 2009 4:56 AM

JokeRe: Event Driven Form Pin
Mycroft Holmes24-Jul-09 23:36
professionalMycroft Holmes24-Jul-09 23:36 
GeneralRe: Event Driven Form Pin
BillWoodruff24-Jul-09 23:55
professionalBillWoodruff24-Jul-09 23:55 
GeneralRe: Event Driven Form Pin
Mycroft Holmes25-Jul-09 0:06
professionalMycroft Holmes25-Jul-09 0:06 
GeneralRe: Event Driven Form Pin
BillWoodruff25-Jul-09 0:42
professionalBillWoodruff25-Jul-09 0:42 
QuestionAero glass extened on an mdi parent Pin
see_seA24-Jul-09 1:42
see_seA24-Jul-09 1:42 
AnswerRe: Aero glass extened on an mdi parent Pin
see_seA25-Jul-09 0:55
see_seA25-Jul-09 0:55 
QuestionDatagridview example Pin
mistryshailesh22-Jul-09 16:52
mistryshailesh22-Jul-09 16:52 
AnswerRe: Datagridview example Pin
Eddy Vluggen22-Jul-09 22:04
professionalEddy Vluggen22-Jul-09 22:04 
NewsWindows 7 RTM Dates Announced; Free Resources to Help Get Ready Pin
brucedkyle22-Jul-09 13:09
brucedkyle22-Jul-09 13:09 
Questionchanging the background color of single word in textbox Pin
Member 232448322-Jul-09 11:46
Member 232448322-Jul-09 11:46 
AnswerRe: changing the background color of single word in textbox Pin
Luc Pattyn22-Jul-09 12:04
sitebuilderLuc Pattyn22-Jul-09 12:04 
GeneralRe: changing the background color of single word in textbox [modified] Pin
Member 232448322-Jul-09 12:13
Member 232448322-Jul-09 12:13 
GeneralRe: changing the background color of single word in textbox Pin
Luc Pattyn22-Jul-09 12:25
sitebuilderLuc Pattyn22-Jul-09 12:25 
GeneralRe: changing the background color of single word in textbox Pin
Member 232448322-Jul-09 13:33
Member 232448322-Jul-09 13:33 
GeneralRe: changing the background color of single word in textbox Pin
Luc Pattyn22-Jul-09 13:41
sitebuilderLuc Pattyn22-Jul-09 13:41 
GeneralRe: changing the background color of single word in textbox Pin
Member 232448322-Jul-09 15:22
Member 232448322-Jul-09 15:22 
GeneralRe: changing the background color of single word in textbox Pin
Luc Pattyn22-Jul-09 15:39
sitebuilderLuc Pattyn22-Jul-09 15:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.