Click here to Skip to main content
15,886,519 members
Home / Discussions / C#
   

C#

 
GeneralDetecting Enter in a Single-line Textbox Pin
Waleed Eissa25-Sep-02 11:30
Waleed Eissa25-Sep-02 11:30 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
leppie25-Sep-02 12:16
leppie25-Sep-02 12:16 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Waleed Eissa25-Sep-02 12:33
Waleed Eissa25-Sep-02 12:33 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley25-Sep-02 12:57
Paul Riley25-Sep-02 12:57 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
leppie25-Sep-02 13:03
leppie25-Sep-02 13:03 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Waleed Eissa27-Sep-02 11:09
Waleed Eissa27-Sep-02 11:09 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 12:32
Paul Riley27-Sep-02 12:32 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Waleed Eissa27-Sep-02 11:46
Waleed Eissa27-Sep-02 11:46 
Thanx for replying my posting, I wonder why it is so hard to do such a trivial thing in .NET ... this is extremely easy to be done in VB or VC++. Actually I want to have an AcceptButton in the form to connect to a database. Ok, here are the details:

I have a form which contains two text boxes and a button (with the caption "Connect") in a groupbox, one of the textboxes is used for entering a path to a DB file, the other textbox is used for entering the DB password for that database (if any), when the button is clicked the application tries to connect to the database using the information in the two textboxes. The button is the AcceptButton for the form (to make it easier for the user .. just enter the location and password then press Enter). One last thing to mention about the button is that when the button is clicked and the connection is made to the datebase the caption of the button is changed from "Connect" to "Disconnect" and if the button is clicked again the connection is closed and the caption is changed back to "Connect" and so on. In the same form I have antoher groupbox which contains a text box and a DataGrid control (disabled if there is no connection to the database). What I want is after the user makes the connection to a database to be able to enter a SQL command in the text box and press Enter then the results of the query is displayed in the datagird control. Of course, this is not possible now because if the user enters a SQL command and then presses Enter, the AcceptButton is clicked and the connection is lost.

The whole purpose of this application is educational. For now, the only way to finish the application was to not use an AcceptButton in the form and use another button beside the SQL command textbox to execute the SQL command when clicked after entering the command in the textbox.

I just find it so natural to be done this way, I want to learn how. Many thanx

(a.k.a. Wal2k)
www.wal2k.com

GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 12:48
Paul Riley27-Sep-02 12:48 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Anonymous27-Sep-02 13:04
Anonymous27-Sep-02 13:04 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 13:15
Paul Riley27-Sep-02 13:15 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Waleed Eissa27-Sep-02 12:24
Waleed Eissa27-Sep-02 12:24 
GeneralRe: Detecting Enter in a Single-line Textbox Pin
Paul Riley27-Sep-02 12:54
Paul Riley27-Sep-02 12:54 
Questionhelp ? Pin
imran_rafique25-Sep-02 11:10
imran_rafique25-Sep-02 11:10 
AnswerRe: help ? Pin
leppie25-Sep-02 12:56
leppie25-Sep-02 12:56 
GeneralOpening Excel workbook Pin
Donald Blachly25-Sep-02 10:26
Donald Blachly25-Sep-02 10:26 
GeneralRe: Opening Excel workbook Pin
Stephane Rodriguez.25-Sep-02 21:11
Stephane Rodriguez.25-Sep-02 21:11 
GeneralRe: Opening Excel workbook Pin
Donald Blachly26-Sep-02 3:50
Donald Blachly26-Sep-02 3:50 
QuestionHow to activate event procedure Pin
D Shen25-Sep-02 9:42
D Shen25-Sep-02 9:42 
AnswerRe: How to activate event procedure Pin
leppie25-Sep-02 9:57
leppie25-Sep-02 9:57 
GeneralRe: How to activate event procedure Pin
D Shen25-Sep-02 10:51
D Shen25-Sep-02 10:51 
GeneralRe: How to activate event procedure Pin
leppie25-Sep-02 11:55
leppie25-Sep-02 11:55 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 3:50
D Shen26-Sep-02 3:50 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 4:15
D Shen26-Sep-02 4:15 
GeneralRe: How to activate event procedure Pin
D Shen26-Sep-02 4:26
D Shen26-Sep-02 4:26 

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.