Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Threading;
- namespace Client
- {
- public partial class Form1 : Form
- {
- // note !-> all the consts' values mean this.width (OR height) / value
- private const int ALLIGMENT_FROM_TOP = 20; // the alligment from the top of the screen
- private const int ALLIGMENT_FROM_LEFT = 20; // the alligment from the Left of the screen
- private const int LOG_IN_FORM_TXT_X_SIZE = 4; // the size of the text boxes in x axis which will be shown on the screen
- private const int LOG_IN_FORM_TEXT_SECTOR_HEIGHT = 2; // the height of the username password and email text boxes
- private const int LOG_IN_FORM_ALLGIMENT_FROM_TEXT_TO_LABEL = 50; // alligment from label to textbox
- private const int LOG_IN_FORM_PICBOX_HEIGHT = 4; // the height of the buttons (width / 4)
- private const int SIGN_OUT_FORM_BACK_HEIGHT_WIDTH = 6; // the height and width of the back button
- private const int CLOSE_GAME_BUTTON_WIDTH = 7; // the width of the close button
- private const int CLOSE_GAME_BUTTON_HEIGHT = 16; // the height of the close button
- private const int MAIN_FORM_PICBOX_HEIGHT = 10; // the height of the picture boxes in main form
- private const int MAIN_FORM_PICBOX_WIDTH = 5; // the width of the picture boxes in the main form
- private const int MAIN_FORM_LOG_OUT_HEIGHT = 12; // the height of the log out button
- private const int MAIN_FORM_LOG_OUT_WIDTH = 7; // the width of the log out button
- private const int BEST_SCORES_FORM_PB_HEIGHT = 4; // the height of the best scores pictures
- private const int BEST_SCORES_FORM_PB_WIDTH = 5; // the width of the best scores picture
- //private static int yAxisSpace; // the space remains after the alligment is substracted in y axis
- //private static int xAxisSpace; // the space remains after the alligment is substracted in x axis
- private MyPictureBox PBClose; // the close button, <> needs to be disposed
- private Thread t; // Thread to handle messages from the server
- private Stream stream; // creates a connection with the server by ip and port
- private int alligmentFromSubjectY; // the alligment in y axis from the subject
- private string uid; // the username of the signed in user
- public Form1()
- {
- this.stream = new Stream("127.0.0.1", 8686);
- t = new Thread(handleMessage);
- t.Start();
- InitializeComponent();
- this.Width = Screen.PrimaryScreen.Bounds.Width;
- this.Height = Screen.PrimaryScreen.Bounds.Height;
- InitStaticVars();
- InitLoginScreen(null, EventArgs.Empty);
- //InitSignUp(null, EventArgs.Empty);
- //InitMainScreen(null, EventArgs.Empty);
- //InitBestScores(null, EventArgs.Empty);
- //KeyValuePair<string, string>[] arr = new KeyValuePair<string, string>[3];
- //arr[0] = new KeyValuePair<string, string>("tal", "100");
- //arr[1] = new KeyValuePair<string, string>("Dolev", "0");
- //arr[2] = new KeyValuePair<string, string>("yarin", "10");
- //changeBestScores(arr);
- //CleanAllControlers();
- }
- /// <summary>
- /// initializes all static variables of custom classes, and current class
- /// </summary>
- public void InitStaticVars()
- {
- // MyTxtBox Class:
- // the default width of the text box
- MyTxtBox._width = (this.Width / LOG_IN_FORM_TXT_X_SIZE);
- // current class:
- // sets the close button
- PBClose = new MyPictureBox("PBClose", "close", new Size(this.Width / CLOSE_GAME_BUTTON_WIDTH, this.Height / CLOSE_GAME_BUTTON_HEIGHT));
- PBClose.Location = new Point(this.Width / 2 - PBClose.Width / 2, this.Height - PBClose.Height - this.Height / ALLIGMENT_FROM_TOP);
- PBClose.Click += PBClose_Click;
- this.Controls.Add(PBClose);
- // sets the alligment from top of screen
- alligmentFromSubjectY = this.Height / ALLIGMENT_FROM_TOP;
- uid = "tal";
- }
- /// <summary>
- /// makes the login is screen
- /// </summary>
- public void InitLoginScreen(object sender, EventArgs args)
- {
- int reminingY = this.Height;
- int nextYPos = 0;
- int xOfTextBoxes = 0;
- int sizeOfPictureBox = 0;
- int alligmentFromPictureBox = 0;
- int alligmentFromTextBoxes = 0;
- int alligmentFromTextBoxesToLabels = this.Width / LOG_IN_FORM_ALLGIMENT_FROM_TEXT_TO_LABEL;
- int xOfPicBoxes = 0;
- List<Control> cont = new List<Control>();
- // sets the background of the page
- this.BackgroundImage = Client.Properties.Resources.loginBG;
- // sets the color of the letters
- this.ForeColor = Color.White;
- // sets the subject label
- Label LBLSubject = new MyLabel("Please Log In", "LBLSubject"); // i create a label to know the width of its text
- LBLSubject.Location = new Point((this.Width / 2) - (LBLSubject.Width / 2), alligmentFromSubjectY);
- cont.Add(LBLSubject);
- nextYPos = LBLSubject.Location.Y + alligmentFromSubjectY + LBLSubject.Height; // begining of details section
- reminingY -= nextYPos; // sets the space of details section
- // sets the text box of username
- TextBox TXTuserName = new MyTxtBox("TXTusername"); // i create a label to know the height of its font
- alligmentFromTextBoxes = ((reminingY / LOG_IN_FORM_TEXT_SECTOR_HEIGHT) - (TXTuserName.Height * 2)) / 3; // generates the needed alligment
- nextYPos += alligmentFromTextBoxes;
- reminingY -= reminingY / LOG_IN_FORM_TEXT_SECTOR_HEIGHT; // sets the space of buttons section
- TXTuserName.Location = new Point((this.Width / 2) - (TXTuserName.Width / 2), nextYPos);
- cont.Add(TXTuserName);
- // sets the label of username
- Label LBLusername = new MyLabel("UserName: ", "LBLusername"); // sets the label of the userName
- LBLusername.Location = new Point(TXTuserName.Location.X - LBLusername.Width - alligmentFromTextBoxesToLabels, nextYPos);
- cont.Add(LBLusername);
- nextYPos += (TXTuserName.Height + alligmentFromTextBoxes); // sets the position of the next textBox
- xOfTextBoxes = TXTuserName.Location.X;
- // sets the text box of password
- TextBox TXTpsw = new MyTxtBox(new Point(xOfTextBoxes, nextYPos), "TXTpsw");
- cont.Add(TXTpsw);
- // sets the label of password
- Label LBLpsw = new MyLabel("password: ", "LBLpsw"); // sets the password label
- LBLpsw.Location = new Point(xOfTextBoxes - LBLpsw.Width - alligmentFromTextBoxesToLabels, nextYPos);
- cont.Add(LBLpsw);
- nextYPos += (TXTuserName.Height + alligmentFromTextBoxes); // sets the begining of the buttons sector
- // sets the buttons section
- sizeOfPictureBox = reminingY / LOG_IN_FORM_PICBOX_HEIGHT;
- reminingY -= (sizeOfPictureBox * 2);
- alligmentFromPictureBox = reminingY / 2;
- // sets the sign in button
- PictureBox PBSignIn = new MyPictureBox("PBSignIn", "SignIn", new Size(TXTuserName.Width, sizeOfPictureBox));
- xOfPicBoxes = (this.Width / 2) - (PBSignIn.Width / 2); // sets the x of picture boxes
- PBSignIn.Location = new Point(xOfPicBoxes, nextYPos);
- PBSignIn.Click += (EventHandler)PBSign_In_Click;
- cont.Add(PBSignIn);
- nextYPos += alligmentFromPictureBox;
- // sets the signup button
- PictureBox PBSignUp = new MyPictureBox("PBSignUp", "SignUp", new Size(PBSignIn.Width, sizeOfPictureBox));
- PBSignUp.Location = new Point(xOfPicBoxes, nextYPos);
- PBSignUp.Click += (EventHandler)(CleanAllControlers);
- PBSignUp.Click += (EventHandler)InitSignUp;
- cont.Add(PBSignUp);
- this.Controls.AddRange(cont.ToArray());
- }
- /// <summary>
- /// sets the form to be sign up page
- /// </summary>
- public void InitSignUp(object sender, EventArgs args)
- {
- int reminingY = this.Height;
- int nextYPos = 0;
- int xOfTextBoxes = 0;
- int sizeOfPictureBox = 0;
- int alligmentFromPictureBox = 0;
- int alligmentFromTextBoxes = 0;
- int alligmentFromTextBoxesToLabels = this.Width / LOG_IN_FORM_ALLGIMENT_FROM_TEXT_TO_LABEL;
- int xOfPicBoxes = 0;
- List<Control> cont = new List<Control>();
- // sets the background
- this.BackgroundImage = Properties.Resources.signUpBG;
- // sets the color of the letters
- this.ForeColor = Color.Black;
- // sets the subject label
- Label LBLSubject = new MyLabel("Please Sign Up", "LBLSubject"); // i create a label to know the width of its text
- LBLSubject.Location = new Point((this.Width / 2) - (LBLSubject.Width / 2), alligmentFromSubjectY);
- cont.Add(LBLSubject);
- nextYPos = LBLSubject.Location.Y + alligmentFromSubjectY + LBLSubject.Height; // begining of details section
- reminingY -= nextYPos; // sets the space of details section
- // sets the text box of username
- TextBox TXTuserName = new MyTxtBox("TXTusername"); // i create a label to know the height of its font
- alligmentFromTextBoxes = ((reminingY / LOG_IN_FORM_TEXT_SECTOR_HEIGHT) - (TXTuserName.Height * 3)) / 4; // generates the needed alligment
- nextYPos += alligmentFromTextBoxes;
- reminingY -= reminingY / LOG_IN_FORM_TEXT_SECTOR_HEIGHT; // sets the space of buttons section
- TXTuserName.Location = new Point((this.Width / 2) - (TXTuserName.Width / 2), nextYPos);
- cont.Add(TXTuserName);
- // sets the label of username
- Label LBLusername = new MyLabel("UserName: ", "LBLusername"); // sets the label of the userName
- LBLusername.Location = new Point(TXTuserName.Location.X - LBLusername.Width - alligmentFromTextBoxesToLabels, nextYPos);
- cont.Add(LBLusername);
- nextYPos += (TXTuserName.Height + alligmentFromTextBoxes); // sets the position of the next textBox
- xOfTextBoxes = TXTuserName.Location.X;
- // sets the text box of password
- TextBox TXTpsw = new MyTxtBox(new Point(xOfTextBoxes, nextYPos), "TXTpsw");
- cont.Add(TXTpsw);
- // sets the label of password
- Label LBLpsw = new MyLabel("password: ", "LBLpsw"); // sets the password label
- LBLpsw.Location = new Point(xOfTextBoxes - LBLpsw.Width - alligmentFromTextBoxesToLabels, nextYPos);
- cont.Add(LBLpsw);
- nextYPos += (TXTuserName.Height + alligmentFromTextBoxes); // sets the position of the next textBox
- // sets the text box of email
- TextBox TXTemail = new MyTxtBox(new Point(xOfTextBoxes, nextYPos), "TXTemail");
- cont.Add(TXTemail);
- // sets the label of email
- Label LBLemail = new MyLabel("email: ", "LBLemail");
- LBLemail.Location = new Point(xOfTextBoxes - LBLemail.Width - alligmentFromTextBoxesToLabels, nextYPos);
- cont.Add(LBLemail);
- nextYPos += (TXTuserName.Height + alligmentFromTextBoxes); // sets the begining of the buttons sector
- // sets the buttons section
- sizeOfPictureBox = reminingY / LOG_IN_FORM_PICBOX_HEIGHT;
- reminingY -= (sizeOfPictureBox * 2);
- alligmentFromPictureBox = reminingY / 2;
- // sets the sign up button
- PictureBox PBSignUp = new MyPictureBox("PBSignUp", "SignUp", new Size(TXTemail.Width, sizeOfPictureBox));
- xOfPicBoxes = (this.Width / 2) - (PBSignUp.Width / 2); // sets the x of picture boxes
- PBSignUp.Location = new Point(xOfPicBoxes, nextYPos);
- PBSignUp.Click += (EventHandler)PBSign_Up_Click;
- //PBSignUp.Click += (EventHandler)CleanAllControlers;
- cont.Add(PBSignUp);
- // sets the back button
- int PCHeight = this.Height / SIGN_OUT_FORM_BACK_HEIGHT_WIDTH;
- int PCWidth = this.Width / SIGN_OUT_FORM_BACK_HEIGHT_WIDTH;
- PictureBox PBBack = new MyPictureBox("PBBack", "back", new Size(PCWidth, PCHeight));
- PBBack.Location = new Point(this.Width - PCWidth, this.Height / ALLIGMENT_FROM_TOP);
- PBBack.Click += (EventHandler)CleanAllControlers;
- PBBack.Click += (EventHandler)InitLoginScreen;
- cont.Add(PBBack);
- this.Controls.AddRange(cont.ToArray());
- }
- /// <summary>
- /// builds the main screen
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="args"></param>
- public void InitMainScreen(object sender, EventArgs args)
- {
- int nextYPos = 0;
- int reminingY = PBClose.Location.Y;
- int heightOfPB = this.Height / MAIN_FORM_PICBOX_HEIGHT;
- int widthOfPB = this.Width / MAIN_FORM_PICBOX_WIDTH;
- int alligmentFromButtonsY = 0;
- int alligmentFromButtonsX = 0;
- // sets the background of the screen
- this.BackgroundImage = Properties.Resources.mainScreenBG;
- // sets the font color to black
- this.ForeColor = Color.Black;
- // sets the subject label
- Label LBLSubject = new MyLabel("Hello " + uid, "LBLSubject"); // i create a label to know the width of its text
- LBLSubject.Location = new Point((this.Width / 2) - (LBLSubject.Width / 2), alligmentFromSubjectY);
- this.Controls.Add(LBLSubject);
- // configures all the propeties needed for the button
- nextYPos = LBLSubject.Location.Y + alligmentFromSubjectY;
- reminingY -= (nextYPos - heightOfPB * 2);
- alligmentFromButtonsY = reminingY / 3;
- nextYPos += (alligmentFromButtonsY / 2);
- alligmentFromButtonsX = (this.Width - widthOfPB * 3) / 3;
- // sets the Join room button
- Button BTNJoin = new MyButton("BTNJoin", new Size(widthOfPB, heightOfPB), "Join Room");
- BTNJoin.Location = new Point(alligmentFromButtonsX, nextYPos);
- this.Controls.Add(BTNJoin);
- // sets the Create room button
- Button BTNCreate = new MyButton("BTNCreate", new Size(widthOfPB, heightOfPB), "Create Room");
- BTNCreate.Location = new Point(this.Width - widthOfPB - alligmentFromButtonsX, nextYPos);
- this.Controls.Add(BTNCreate);
- nextYPos += alligmentFromButtonsY;
- // sets the best scores button
- Button BTNBest = new MyButton("BTNBest", new Size(widthOfPB, heightOfPB), "Best Scores");
- BTNBest.Location = new Point(alligmentFromButtonsX, nextYPos);
- BTNBest.Click += (EventHandler)CleanAllControlers;
- BTNBest.Click += (EventHandler)InitBestScores;
- BTNBest.Click += (EventHandler)BTNBest_Click;
- this.Controls.Add(BTNBest);
- // sets the personal status
- Button BTNPersonal = new MyButton("BTNPersonal", new Size(widthOfPB, heightOfPB), "My Status");
- BTNPersonal.Location = new Point(this.Width - widthOfPB - alligmentFromButtonsX, nextYPos);
- this.Controls.Add(BTNPersonal);
- // sets the logout button
- PictureBox PBLogOut = new MyPictureBox("PBLogOut", "signOut", new Size(this.Height / MAIN_FORM_LOG_OUT_WIDTH, this.Width / MAIN_FORM_LOG_OUT_HEIGHT));
- PBLogOut.Location = new Point(this.Width / ALLIGMENT_FROM_LEFT, this.Height / ALLIGMENT_FROM_TOP);
- PBLogOut.Click += (EventHandler)CleanAllControlers;
- PBLogOut.Click += (EventHandler)InitLoginScreen;
- PBLogOut.Click += (EventHandler)PBLogOut_Click;
- this.Controls.Add(PBLogOut);
- }
- /// <summary>
- /// changes the form to show the best scores
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="args"></param>
- private void InitBestScores(object sender, EventArgs args)
- {
- int reminingY = PBClose.Location.Y;
- int nextYPos = 0;
- int pictureBoxHeight = 0;
- int pictureBoxWidth = 0;
- int alligmentFromPicturesY = 0;
- int alligmentFromPictureX = 0;
- // sets the background image to best scores BG
- this.BackgroundImage = Properties.Resources.winners;
- // sets the font of the form to black
- this.ForeColor = Color.Black;
- // sets the subject label
- Label LBLSubject = new MyLabel("Best Scores: ", "LBLSubject"); // i create a label to know the width of its text
- LBLSubject.Location = new Point((this.Width / 2) - (LBLSubject.Width / 2), alligmentFromSubjectY);
- this.Controls.Add(LBLSubject);
- // creates the label that contains the first player's scores
- Label LBL1st = new MyLabel("ABCD", "LBL1st"); // i put text in the label so i can know its properties
- // sets the next position for the picture boxes sector
- nextYPos += (LBLSubject.Location.Y + LBLSubject.Height + alligmentFromSubjectY);
- reminingY -= nextYPos;
- // configures the properties of the picture boxes
- pictureBoxHeight = reminingY / BEST_SCORES_FORM_PB_HEIGHT;
- pictureBoxWidth = this.Width / BEST_SCORES_FORM_PB_WIDTH;
- // configures the picture box sector
- alligmentFromPicturesY = (reminingY - pictureBoxHeight * 2 - LBL1st.Height * 2) / 2;
- alligmentFromPictureX = (this.Width - pictureBoxWidth * 3) / 4;
- nextYPos += alligmentFromPicturesY;
- // sets the first place picture box
- PictureBox PB1st = new MyPictureBox("PB1st", "_1st", new Size(pictureBoxWidth, pictureBoxHeight));
- PB1st.Location = new Point(alligmentFromPictureX * 2 + pictureBoxWidth, nextYPos);
- this.Controls.Add(PB1st);
- LBL1st.Location = new Point(PB1st.Location.X + PB1st.Width / 2, nextYPos - LBL1st.Height);
- this.Controls.Add(LBL1st);
- // sets the postion to the next picture box
- nextYPos += alligmentFromPicturesY;
- // sets the second best score picture box
- PictureBox PB2nd = new MyPictureBox("PB2nd", "_2nd", new Size(pictureBoxWidth, pictureBoxHeight));
- PB2nd.Location = new Point(alligmentFromPictureX, nextYPos);
- this.Controls.Add(PB2nd);
- // sets the label of the second best score
- Label LBL2nd = new MyLabel("ABCD", "LBL2nd"); // i put text in the label so i can know its properties
- LBL2nd.Location = new Point(PB2nd.Location.X + PB2nd.Width / 2, PB2nd.Location.Y - LBL2nd.Height);
- this.Controls.Add(LBL2nd);
- // sets the picture box of the second best score
- PictureBox PB3rd = new MyPictureBox("PB3rd", "_3rd", new Size(pictureBoxWidth, pictureBoxHeight));
- PB3rd.Location = new Point(this.Width - alligmentFromPictureX - PB3rd.Width, nextYPos);
- this.Controls.Add(PB3rd);
- // sets the label of th ethird best score
- Label LBL3rd = new MyLabel("ABCD", "LBL3rd"); // i put text in the label so i can know its properties
- LBL3rd.Location = new Point(PB3rd.Location.X + PB3rd.Width / 2, nextYPos - LBL3rd.Height);
- this.Controls.Add(LBL3rd);
- // sets the back button
- int PCHeight = this.Height / SIGN_OUT_FORM_BACK_HEIGHT_WIDTH;
- int PCWidth = this.Width / SIGN_OUT_FORM_BACK_HEIGHT_WIDTH;
- PictureBox PBBack = new MyPictureBox("PBBack", "back", new Size(PCWidth, PCHeight));
- PBBack.Location = new Point(this.Width - PCWidth, this.Height / ALLIGMENT_FROM_TOP);
- PBBack.Click += (EventHandler)CleanAllControlers;
- PBBack.Click += (EventHandler)InitMainScreen;
- this.Controls.Add(PBBack);
- }
- /// <summary>
- /// changes the best scores labels
- /// should be used when clicked on get best scores button, after InitBestScores was called
- /// </summary>
- /// <param name="arr">an array of pairs in which the key is the name of the user and the value is his score</param>
- private void changeBestScores(KeyValuePair<string, string>[] arr)
- {
- Label[] labels = new Label[3];
- labels[0] = this.Controls.Find("LBL1st", false).FirstOrDefault() as Label;
- labels[1] = this.Controls.Find("LBL2nd", false).FirstOrDefault() as Label;
- labels[2] = this.Controls.Find("LBL3rd", false).FirstOrDefault() as Label;
- for (int i = 0; i < 3; i++ )
- {
- if(labels[i] != null)
- {
- labels[i].Text = arr[i].Key + ": " + arr[i].Value;
- labels[i].Width = TextRenderer.MeasureText(labels[i].Text, labels[i].Font).Width;
- labels[i].Location = new Point(labels[i].Location.X - labels[i].Width / 2, labels[i].Location.Y);
- }
- }
- }
- /// <summary>
- /// cleans the screen from all the controls on it
- /// </summary>
- private void CleanAllControlers(object sender, EventArgs args)
- {
- //foreach (Control c in this.Controls)
- //{
- // MessageBox.Show(c.GetType().ToString());
- // this.Controls.Remove(c);
- //}
- this.Controls.Clear();
- this.Controls.Add(PBClose);
- }
- private void PBClose_Click(object sender, EventArgs args)
- {
- this.Close();
- }
- private void BTNBest_Click(object sender, EventArgs args)
- {
- // ... executed when best scores button clicked
- }
- private void PBLogOut_Click(object sender, EventArgs args)
- {
- // ... executed when log out button is clicked
- }
- /// <summary>
- /// sends the username, password and email to server according to the format for sign up
- /// </summary>
- private void PBSign_Up_Click(object sender, EventArgs args)
- {
- TextBox txtUserName = (TextBox)this.Controls.Find("TXTusername", false)[0];
- TextBox txtPassword = (TextBox)this.Controls.Find("TXTpsw", false)[0];
- TextBox txtEmail = (TextBox)this.Controls.Find("TXTemail", false)[0];
- if (txtUserName != null && txtPassword != null && txtEmail != null)
- {
- this.stream.sendData(String.Format("203{0:00}{1}{2:00}{3}{4:00}{5}", txtUserName.Text.Length, txtUserName.Text, txtPassword.Text.Length, txtPassword.Text, txtEmail.Text.Length, txtEmail.Text));
- }
- }
- /// <summary>
- /// sends the username and password to server according to the format for sign in
- /// </summary>
- private void PBSign_In_Click(object sender, EventArgs e)
- {
- TextBox txtUserName = (TextBox)this.Controls.Find("TXTusername", false)[0];
- TextBox txtPassword = (TextBox)this.Controls.Find("TXTpsw", false)[0];
- if (txtUserName != null && txtPassword != null)
- {
- this.stream.sendData(String.Format("200{0:00}{1}{2:00}{3}", txtUserName.Text.Length, txtUserName.Text, txtPassword.Text.Length, txtPassword.Text));
- }
- }
- private void handleMessage()
- {
- string msg = "";
- while (true)
- {
- msg = this.stream.recvData();
- switch (int.Parse(msg))
- {
- case 1020:
- MessageBox.Show("Success Sign in");
- uid = ((TextBox)this.Controls.Find("TXTusername", false)[0]).Text;
- Invoke((MethodInvoker) (() => CleanAllControlers(null, EventArgs.Empty)));
- Invoke((MethodInvoker) (() => InitMainScreen(null, EventArgs.Empty)));
- break;
- case 1021:
- MessageBox.Show("Wrong Details Sign in");
- break;
- case 1022:
- MessageBox.Show("User is already connected Sign in");
- break;
- case 1040:
- MessageBox.Show("Success Sign up");
- Invoke((MethodInvoker) (() => CleanAllControlers(null, EventArgs.Empty)));
- Invoke((MethodInvoker) (() => this.InitLoginScreen(null, EventArgs.Empty)));
- break;
- case 1041:
- MessageBox.Show("WPass illegal Sign up");
- break;
- case 1042:
- MessageBox.Show("Username is already exists Sign up");
- break;
- case 1043:
- MessageBox.Show("Username is illegal Sign up");
- break;
- case 1044:
- MessageBox.Show("Other Sign up");
- break;
- }
- }
- }
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- this.t.Abort();
- this.stream.sendData("299");
- this.stream.CloseStream();
- this.PBClose.Dispose();
- }
- }
- }
- // TODO:
- // set font according to resulution
- // remove the size of the Close button from the login and signup pages
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement