Click here to Skip to main content
15,897,291 members
Home / Discussions / C#
   

C#

 
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 
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 
You'll have to implement this check in your static void Main() in your Program.CS. You can do something like this:

static void Main()
{
  if (true == YourCondition)
  {
    yourMainForm MainForm = new yourMainForm ();
    Application.Run();
  }
  else
  {
    MessageBox.Show("Some condition hasn't been met. Must close.");
    Application.Exit();
  }
}


I remember a while back I was trying to do the same thing. I can't remember why, but you can't close the form, without it showing, until after it has been initialized and loaded. So, the work-around is to preform your check in your Main method in Program.CS.

I'm going to become rich when I create a device that allows me to punch people in the face over the internet.

"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

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 
GeneralRe: How to pass data between two applications on the single system? Pin
Hari Om Prakash Sharma28-Jan-08 0:57
Hari Om Prakash Sharma28-Jan-08 0:57 
GeneralRe: How to pass data between two applications on the single system? Pin
Ashfield28-Jan-08 1:13
Ashfield28-Jan-08 1:13 
GeneralRe: How to pass data between two applications on the single system? Pin
Pete O'Hanlon28-Jan-08 1:29
mvePete O'Hanlon28-Jan-08 1:29 
Questionhow to modify dictionary value Pin
justintimberlake27-Jan-08 23:58
justintimberlake27-Jan-08 23:58 
AnswerRe: how to modify dictionary value Pin
Justin Perez28-Jan-08 4:20
Justin Perez28-Jan-08 4:20 
GeneralRe: how to modify dictionary value Pin
justintimberlake28-Jan-08 16:21
justintimberlake28-Jan-08 16:21 

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.