Click here to Skip to main content
15,903,012 members
Home / Discussions / C#
   

C#

 
GeneralDataColumn Caption property doesn't works. Pin
Carlos Lopes30-Aug-01 0:40
Carlos Lopes30-Aug-01 0:40 
Generalfsream Pin
25-Aug-01 5:42
suss25-Aug-01 5:42 
GeneralI want to read an ASP recordset in C# component Pin
Csmart24-Aug-01 2:49
Csmart24-Aug-01 2:49 
GeneralRe: I found it myself Pin
14-Sep-01 3:20
suss14-Sep-01 3:20 
GeneralDataRow Caption property doesn't works. Pin
Carlos Lopes23-Aug-01 0:13
Carlos Lopes23-Aug-01 0:13 
QuestionSelecting a branch in a TreeView? Pin
Andreas Philipson21-Aug-01 12:46
Andreas Philipson21-Aug-01 12:46 
General"RETURN" key as "TAB" key Pin
Carlos Lopes19-Aug-01 21:55
Carlos Lopes19-Aug-01 21:55 
GeneralRe: "RETURN" key as "TAB" key Pin
Richard Dean14-Apr-09 0:11
Richard Dean14-Apr-09 0:11 
Hi Carlos
I am not to sure how long your message has been there and I am new to the "reply" function of the code-project.
If you have not resolved the matter- Read on!

I am assuming you are want to use the return/enter key to move from one control to another

A group of textboxes for example? with the "Type in data then press enter" option?

If so, about two years ago I had been racking my brain trying to figure out how to do that then came across the "SelectNextControl" method - from the code-project.
There are five parameters to the "SelectNextControl" method. These are

Ctl
The Control at which to start the search.

forward
true to move forward in the tab order; false to move backward in the tab order.

tabStopOnly
true to ignore the controls with the TabStop property set to false; otherwise, false.

nested
true to include nested (children of child controls) child controls; otherwise, false.

wrap
true to continue searching from the first control in the tab order after the last control has been reached; otherwise, false.

Return Value
true if a control was activated; otherwise, false.


If you are trying to use textboxes then generate two event handlers one for keydown and one for leave
the leave event I use for validating and entering the data into the program.
the keydown is to detect if a key is down (crazy that eh!)
I have several textboxes and the use exactly the same leave and keydown event handlers, in the case below "tbxUpper"

private void tbxUpper_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                TextBox tbx = (TextBox)sender;
                SelectNextControl(tbx, true, true, true, true);
            }
        }

the above event actually fires every time a key is presses in a text box but the "if statement" looks for the return key. when the return key is pressed a textbox called tbx is generated and copied from sender then the next control is selected.
If you need furthur help post a reply "and then hit Enter"!!
GeneralC Pin
doso18-Aug-01 1:44
doso18-Aug-01 1:44 
GeneralRe: C Pin
Christian Graus18-Aug-01 2:06
protectorChristian Graus18-Aug-01 2:06 
GeneralRe: C Pin
doso18-Aug-01 2:32
doso18-Aug-01 2:32 
GeneralRe: C Pin
Christian Graus18-Aug-01 2:41
protectorChristian Graus18-Aug-01 2:41 
GeneralRe: C Pin
doso18-Aug-01 3:03
doso18-Aug-01 3:03 
Generalaccess public controls on form2 from form1 Pin
Carlos Lopes16-Aug-01 0:52
Carlos Lopes16-Aug-01 0:52 
GeneralRe: access public controls on form2 from form1 Pin
16-Aug-01 7:13
suss16-Aug-01 7:13 
GeneralC# API reference Pin
Langweilig15-Aug-01 17:56
Langweilig15-Aug-01 17:56 
GeneralRe: C# API reference Pin
Eric Gunnerson (msft)19-Aug-01 9:15
Eric Gunnerson (msft)19-Aug-01 9:15 
GeneralMeasureString bug or feature Pin
9-Aug-01 22:08
suss9-Aug-01 22:08 
GeneralRe: MeasureString bug or feature Pin
Andrei Zenkovitch15-Aug-01 5:53
Andrei Zenkovitch15-Aug-01 5:53 
GeneralRe: MeasureString bug or feature Pin
16-Aug-01 7:40
suss16-Aug-01 7:40 
GeneralC# Tutorials Pin
8-Aug-01 1:10
suss8-Aug-01 1:10 
GeneralRe: C# Tutorials Pin
David Cunningham4-Sep-01 15:32
cofounderDavid Cunningham4-Sep-01 15:32 
GeneralSending images in html mail Pin
Henk3-Aug-01 23:35
Henk3-Aug-01 23:35 
GeneralRe: Sending images in html mail Pin
Steve Maier5-Aug-01 3:52
professionalSteve Maier5-Aug-01 3:52 
GeneralA problem about "ResourceManager" Pin
fwy_beyond2-Aug-01 21:08
fwy_beyond2-Aug-01 21:08 

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.