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

C#

 
GeneralRe: TCP chat Pin
#realJSOP6-Sep-08 2:09
mve#realJSOP6-Sep-08 2:09 
GeneralRe: TCP chat Pin
PIEBALDconsult6-Sep-08 4:10
mvePIEBALDconsult6-Sep-08 4:10 
AnswerRe: TCP chat Pin
Mbah Dhaim6-Sep-08 8:08
Mbah Dhaim6-Sep-08 8:08 
AnswerRe: TCP chat Pin
nelsonpaixao7-Sep-08 13:14
nelsonpaixao7-Sep-08 13:14 
GeneralRe: TCP chat Pin
priyajeni7-Sep-08 18:33
priyajeni7-Sep-08 18:33 
Questionlogin dialog help Pin
captjack5-Sep-08 16:43
captjack5-Sep-08 16:43 
AnswerRe: login dialog help Pin
Ravi Kumar Tyagi5-Sep-08 18:39
Ravi Kumar Tyagi5-Sep-08 18:39 
AnswerRe: login dialog help Pin
zafersavas5-Sep-08 18:51
zafersavas5-Sep-08 18:51 
There is a simpler way to do that:
Lets say we have two forms:
1) Form1 : The main form
2) FormLogon : Logon form that should appear at the beginning

onLoad of Form1:
private void Form1_Load(object sender, EventArgs e)
{
   this.Visible = false;
    
   FormLogon myFormLogon = new FormLogon();
   myFormLogon.ShowDialog(this);

   if (myFormLogon.logonResult == 1)
      this.Visible = true;
   else
      Application.Exit();
}

In FormlLogon have a public variable named logonResult to track which button was clicked.
public int logonResult = 0;
private void button1_Click(object sender, EventArgs e) // Logon Button
{
   logonResult = 1;
   Close();
}
private void button2_Click(object sender, EventArgs e) // Cancel button
{
   Close();
}

GeneralRe: login dialog help Pin
captjack6-Sep-08 4:12
captjack6-Sep-08 4:12 
GeneralRe: login dialog help Pin
zafersavas6-Sep-08 4:21
zafersavas6-Sep-08 4:21 
QuestionMobile Pin
nelsonpaixao5-Sep-08 13:55
nelsonpaixao5-Sep-08 13:55 
AnswerRe: Mobile Pin
Blue_Boy5-Sep-08 19:41
Blue_Boy5-Sep-08 19:41 
AnswerRe: Mobile Pin
CaptainKrtek7-Sep-08 8:55
CaptainKrtek7-Sep-08 8:55 
QuestionRight click GridView Pin
Jacob Dixon5-Sep-08 10:34
Jacob Dixon5-Sep-08 10:34 
AnswerRe: Right click GridView Pin
Bassam Saoud5-Sep-08 11:29
Bassam Saoud5-Sep-08 11:29 
GeneralRe: Right click GridView Pin
Jacob Dixon5-Sep-08 14:03
Jacob Dixon5-Sep-08 14:03 
AnswerRe: Right click GridView Pin
Mycroft Holmes5-Sep-08 13:47
professionalMycroft Holmes5-Sep-08 13:47 
GeneralRe: Right click GridView Pin
Jacob Dixon5-Sep-08 14:02
Jacob Dixon5-Sep-08 14:02 
Questionchange statusBar to Vista;s system tray style Pin
Jassim Rahma5-Sep-08 9:16
Jassim Rahma5-Sep-08 9:16 
QuestionFacade design pattern examples Pin
Member 39190495-Sep-08 8:52
Member 39190495-Sep-08 8:52 
AnswerRe: Facade design pattern examples Pin
MidwestLimey5-Sep-08 11:11
professionalMidwestLimey5-Sep-08 11:11 
GeneralRe: Facade design pattern examples Pin
Member 39190496-Sep-08 5:53
Member 39190496-Sep-08 5:53 
QuestionThe preferred way to return a DataSet in ADO.NET 2.0 Pin
Member 39190495-Sep-08 8:20
Member 39190495-Sep-08 8:20 
AnswerRe: The preferred way to return a DataSet in ADO.NET 2.0 Pin
PIEBALDconsult5-Sep-08 13:10
mvePIEBALDconsult5-Sep-08 13:10 
GeneralRe: The preferred way to return a DataSet in ADO.NET 2.0 Pin
Mycroft Holmes5-Sep-08 13:52
professionalMycroft Holmes5-Sep-08 13:52 

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.