Click here to Skip to main content
15,923,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: Convert a row of a 2d array into a 1d array. Pin
Ennis Ray Lynch, Jr.28-Jan-08 8:46
Ennis Ray Lynch, Jr.28-Jan-08 8:46 
GeneralRe: Convert a row of a 2d array into a 1d array. Pin
Dan Neely28-Jan-08 9:09
Dan Neely28-Jan-08 9:09 
GeneralRe: Convert a row of a 2d array into a 1d array. Pin
Ennis Ray Lynch, Jr.28-Jan-08 9:20
Ennis Ray Lynch, Jr.28-Jan-08 9:20 
GeneralRe: Convert a row of a 2d array into a 1d array. Pin
PIEBALDconsult28-Jan-08 13:09
mvePIEBALDconsult28-Jan-08 13:09 
GeneralRe: Convert a row of a 2d array into a 1d array. Pin
Ennis Ray Lynch, Jr.28-Jan-08 14:07
Ennis Ray Lynch, Jr.28-Jan-08 14:07 
Generalvisual web developer Pin
zeeShan anSari28-Jan-08 3:12
zeeShan anSari28-Jan-08 3:12 
GeneralRe: visual web developer Pin
Gareth H28-Jan-08 4:53
Gareth H28-Jan-08 4:53 
GeneralClosing a form before it even shows Pin
Dewald28-Jan-08 2:49
Dewald28-Jan-08 2:49 
Hi all,

I'm trying to implement code that will shut down a form before it is even shown, in my case the form is an MDI child but I suppose the same principle will hold for any type of form.

The MDI parent invokes the form:
FormUser objfrmUser = new FormUser();<br />
objfrmUser.MdiParent = this;<br />
objfrmUser.Show();


I want the form itself to do some check that will determine whether it may be shown or not and, if not, display a nice little MessageBox after which it closes down. Something like:
if (doTest())<br />
{<br />
   MessageBox.Show("No can do");<br />
   this.Close();<br />
}


If I put this code in the Activated event handler I get an exception informing me that "Value Close() cannot be called while doing CreateHandle()".

If I put the code in the Shown event handler it works sort of. It displays the message and closes the form gracefully but it shows the form first and then display the message. I don't want the form to be visible when the message is shown.

Any ideas?
GeneralRe: Closing a form before it even shows Pin
leppie28-Jan-08 3:46
leppie28-Jan-08 3:46 
GeneralRe: Closing a form before it even shows Pin
CKnig28-Jan-08 3:56
CKnig28-Jan-08 3:56 
GeneralRe: Closing a form before it even shows Pin
CKnig28-Jan-08 3:51
CKnig28-Jan-08 3:51 
GeneralRe: Closing a form before it even shows Pin
Dewald28-Jan-08 19:12
Dewald28-Jan-08 19:12 
GeneralRe: Closing a form before it even shows Pin
BadKarma28-Jan-08 4:08
BadKarma28-Jan-08 4:08 
GeneralRe: Closing a form before it even shows Pin
Justin Perez28-Jan-08 4:14
Justin Perez28-Jan-08 4:14 
GeneralListview:extracting info from Hidden column Pin
Adnan Siddiqi28-Jan-08 2:10
Adnan Siddiqi28-Jan-08 2:10 
GeneralRe: Listview:extracting info from Hidden column Pin
led mike28-Jan-08 6:24
led mike28-Jan-08 6:24 
GeneralRe: Listview:extracting info from Hidden column Pin
Adnan Siddiqi28-Jan-08 7:12
Adnan Siddiqi28-Jan-08 7:12 
GeneralRe: Listview:extracting info from Hidden column Pin
led mike28-Jan-08 7:21
led mike28-Jan-08 7:21 
QuestionHow to print a current doucument with print privews using asp.net with c#.net Pin
srinivassrinitha28-Jan-08 2:02
srinivassrinitha28-Jan-08 2:02 
GeneralRe: How to print a current doucument with print privews using asp.net with c#.net Pin
Pete O'Hanlon28-Jan-08 2:12
mvePete O'Hanlon28-Jan-08 2:12 
GeneralHelp with Logon Pin
MumbleB28-Jan-08 1:42
MumbleB28-Jan-08 1:42 
QuestionHow to pass data between two applications on the single system? Pin
Hari Om Prakash Sharma28-Jan-08 0:29
Hari Om Prakash Sharma28-Jan-08 0:29 
GeneralRe: How to pass data between two applications on the single system? Pin
Anthony Mushrow28-Jan-08 0:46
professionalAnthony Mushrow28-Jan-08 0:46 
GeneralRe: How to pass data between two applications on the single system? Pin
Hari Om Prakash Sharma28-Jan-08 1:04
Hari Om Prakash Sharma28-Jan-08 1:04 
QuestionRe: How to pass data between two applications on the single system? Pin
Ashfield28-Jan-08 0:49
Ashfield28-Jan-08 0:49 

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.