Click here to Skip to main content
15,889,830 members
Home / Discussions / C#
   

C#

 
QuestionFirewall??? Pin
Duong Tien Nam5-Jun-05 15:31
Duong Tien Nam5-Jun-05 15:31 
AnswerRe: Firewall??? Pin
rocky_pulley6-Jun-05 2:25
rocky_pulley6-Jun-05 2:25 
GeneralUsing an image as a resource programmatically... Pin
new_phoenix5-Jun-05 14:53
new_phoenix5-Jun-05 14:53 
GeneralRe: Using an image as a resource programmatically... Pin
Christian Graus5-Jun-05 15:18
protectorChristian Graus5-Jun-05 15:18 
GeneralRe: Using an image as a resource programmatically... Pin
new_phoenix7-Jun-05 9:24
new_phoenix7-Jun-05 9:24 
GeneralWinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 12:09
protectorChristian Graus5-Jun-05 12:09 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
DavidNohejl5-Jun-05 12:44
DavidNohejl5-Jun-05 12:44 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 12:51
protectorChristian Graus5-Jun-05 12:51 
dnh wrote:
Did you debug/F11 every line?

Fair question.

Of course. this.Close is NOT called at all. That's why I changed my if block ( before I just had return after the message box ). In fact, if I click Cancel in the second dialog, and then put breakpoints in the parent dialog, neither click handler is called ( OK or Cancel buttons ), but the dialog closes. DialogResult is set to Cancel, so I 'fixed' it for now ( had to send to the client ) by using a bool and stopping the close behaviour if Cancel has not been clicked. Stepping through the OK code in the main dialog, same thing. The message box code runs, then next code I can step to is the code in the main form that created the dialog, unless I create an OnClosing handler in there as well. I have no idea why they are closing, but it's not from my code.

dnh wrote:
Although setting the DialogResult property will cause your dialog box to close automatically, you can still handle the control's Click event, and the dialog box will close once the event handler's code is finished. While handling the Click event, you may want to halt the closure of the dialog box."

Yes, I killed all my automatic closing of dialog boxes as a first step. I've quintuple checked, and they are all set to 'none'.

dnh wrote:
Are you sure that you aren't missing something obvious? (like code to stop closing in your second dialog? - see link)

I didn't see any code in that link that seemed to help, perhaps I missed something, but my buttons are definately not set to automatically close the dialog, and certainly the problem with the second dialog is not calling either button event handler at all. If all else fails, I may have to keep the ugly bool solution and impliment something similar in the main dialog. Yuck - that's got to be a hack. I'd far rather learn what weird configuration issue is causing this. The second dialog has a similar message box setup, and it works fine there, but I can't see anything different in how the dialogs are set up.

Christian Graus - Microsoft MVP - C++
GeneralRe: WinForms keeps closing my dialogs !!! Pin
DavidNohejl5-Jun-05 13:46
DavidNohejl5-Jun-05 13:46 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Judah Gabriel Himango5-Jun-05 13:43
sponsorJudah Gabriel Himango5-Jun-05 13:43 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 13:46
protectorChristian Graus5-Jun-05 13:46 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
DavidNohejl5-Jun-05 13:47
DavidNohejl5-Jun-05 13:47 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Scott Serl5-Jun-05 14:49
Scott Serl5-Jun-05 14:49 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 15:16
protectorChristian Graus5-Jun-05 15:16 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Ashok Dhamija5-Jun-05 18:34
Ashok Dhamija5-Jun-05 18:34 
GeneralRe: WinForms keeps closing my dialogs !!! Pin
Christian Graus5-Jun-05 18:38
protectorChristian Graus5-Jun-05 18:38 
GeneralAdd Refrences in runTime Pin
Web cam5-Jun-05 9:58
Web cam5-Jun-05 9:58 
GeneralRe: Add Refrences in runTime Pin
Carsten Zeumer5-Jun-05 11:40
Carsten Zeumer5-Jun-05 11:40 
GeneralRe: Add Refrences in runTime Pin
DavidNohejl5-Jun-05 12:04
DavidNohejl5-Jun-05 12:04 
QuestionCOORDINATES NOT CENTERED? Pin
...---...5-Jun-05 7:00
...---...5-Jun-05 7:00 
AnswerRe: COORDINATES NOT CENTERED? Pin
S. Senthil Kumar5-Jun-05 7:21
S. Senthil Kumar5-Jun-05 7:21 
GeneralRe: COORDINATES NOT CENTERED? Pin
Anonymous5-Jun-05 9:07
Anonymous5-Jun-05 9:07 
AnswerRe: COORDINATES NOT CENTERED? Pin
Carsten Zeumer5-Jun-05 8:09
Carsten Zeumer5-Jun-05 8:09 
Generalnew removable storage media Pin
heikogerdd5-Jun-05 6:13
heikogerdd5-Jun-05 6:13 
GeneralRe: new removable storage media Pin
Anonymous5-Jun-05 15:51
Anonymous5-Jun-05 15:51 

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.