Click here to Skip to main content
15,906,335 members
Home / Discussions / C#
   

C#

 
QuestionDialog box exit Pin
baronics20-Sep-05 2:37
baronics20-Sep-05 2:37 
I have a modal dialog box with AcceptButton & CancelButton

Is there a way to test if the dialog was closed with the user pressing 'Enter' as apposed to using the mouse to click either of the buttons or the control box?

MyDialog dlg = new MyDialog();
DialogResult rc = dlg.ShowDialog();
if(dlg.wasEnterPressed()) ...

The 'Click' event on the AcceptButton fires for both mouse & keypress.
I tried to look at the KeyDown event but that doesn't fire when 'Enter' is pressed.

AnswerRe: Dialog box exit Pin
Ashok Dhamija20-Sep-05 3:22
Ashok Dhamija20-Sep-05 3:22 
GeneralRe: Dialog box exit Pin
baronics20-Sep-05 4:58
baronics20-Sep-05 4:58 
QuestionC# ,Directx and MPEG2 encoding Pin
Member 242731820-Sep-05 2:33
Member 242731820-Sep-05 2:33 
QuestionOverhead Representation Pin
PHDENG8120-Sep-05 1:24
PHDENG8120-Sep-05 1:24 
AnswerRe: Overhead Representation Pin
Anonymous20-Sep-05 4:46
Anonymous20-Sep-05 4:46 
AnswerRe: Overhead Representation Pin
Anonymous20-Sep-05 4:46
Anonymous20-Sep-05 4:46 
QuestionCapturing Frames from a AVI File Pin
Balasubramanian_198020-Sep-05 1:00
Balasubramanian_198020-Sep-05 1:00 
AnswerRe: Capturing Frames from a AVI File Pin
Andrew Kirillov20-Sep-05 2:17
Andrew Kirillov20-Sep-05 2:17 
AnswerRe: Capturing Frames from a AVI File Pin
Andrew Kirillov20-Sep-05 3:42
Andrew Kirillov20-Sep-05 3:42 
QuestionHeader / Detail in c# Pin
dabuskol20-Sep-05 0:48
dabuskol20-Sep-05 0:48 
QuestionForm Controls Pin
deepscyberpulse20-Sep-05 0:24
deepscyberpulse20-Sep-05 0:24 
AnswerRe: Form Controls Pin
NanaAM20-Sep-05 0:58
NanaAM20-Sep-05 0:58 
AnswerRe: Form Controls Pin
Ashok Dhamija20-Sep-05 3:34
Ashok Dhamija20-Sep-05 3:34 
Question"typeloadexception" What is this? How i solve it? Pin
Campaniço20-Sep-05 0:13
Campaniço20-Sep-05 0:13 
AnswerRe: "typeloadexception" What is this? How i solve it? Pin
S. Senthil Kumar20-Sep-05 2:10
S. Senthil Kumar20-Sep-05 2:10 
Questionhow to hide a column in Data Grid Pin
Rizwan Bashir19-Sep-05 23:30
Rizwan Bashir19-Sep-05 23:30 
AnswerRe: how to hide a column in Data Grid Pin
dabuskol20-Sep-05 0:25
dabuskol20-Sep-05 0:25 
GeneralRe: how to hide a column in Data Grid Pin
Rizwan Bashir20-Sep-05 2:34
Rizwan Bashir20-Sep-05 2:34 
GeneralRe: how to hide a column in Data Grid Pin
miah alom20-Sep-05 4:07
miah alom20-Sep-05 4:07 
AnswerRe: how to hide a column in Data Grid Pin
dabuskol20-Sep-05 19:14
dabuskol20-Sep-05 19:14 
QuestionNew serial device problem.. + an old one Pin
cue_ball19-Sep-05 22:21
cue_ball19-Sep-05 22:21 
QuestionRegarding WebBrower Control Pin
A.Grover19-Sep-05 21:46
A.Grover19-Sep-05 21:46 
AnswerRe: Regarding WebBrower Control Pin
seee sharp19-Sep-05 22:02
seee sharp19-Sep-05 22:02 
GeneralRe: Regarding WebBrower Control Pin
A.Grover19-Sep-05 22:43
A.Grover19-Sep-05 22:43 

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.