コード例 #1
0
ファイル: Form1.cs プロジェクト: nekosaur/Haytham
        private void button1_Click(object sender, EventArgs e)
        {
            ClientStatus.client   = new TcpClient();
            ClientStatus.serverip = IPAddress.Parse(textBox1.Text);;



            try
            {
                ClientStatus.client.Connect(ClientStatus.serverip, 50000);
            }
            catch (Exception ee)
            {
                MessageBox.Show("Server not found\r\n" + "Check the server IP again!");
                return;
            }



            Form_Recipe form_Recipe;

            ClientStatus.Connect();
            form_Recipe = new Form_Recipe(this);
            form_Recipe.Show();
            this.Hide();
        }
コード例 #2
0
        public Form_Recognition(Form_Recipe frm, Rectangle rect)
        {
            InitializeComponent();

            Icon ico = new Icon(Properties.Resources.Untitled_2, 64, 64);

            this.Icon = ico;

            Form_recipe = frm;

            System.Reflection.Assembly assembly = this.GetType().Assembly;


            this.Left = rect.Left;
            this.Top  = rect.Top;

            this.Width  = rect.Width;
            this.Height = rect.Height;

            Bitmap bmp = new Bitmap(assembly.GetManifestResourceStream(string.Format("Haytham_Client.Resources.{0}.png", ClientStatus.clientIndex)));

            pictureBox1.Image = bmp;
            // this.Width = Screen.PrimaryScreen.Bounds.Width;
            // this.Height = Screen.PrimaryScreen.Bounds.Height;

            pictureBox1.Left = (this.Width - pictureBox1.Width) / 2;
            pictureBox1.Top  = (this.Height - pictureBox1.Height) / 2;



            pictureBox1.Refresh();
        }