public NumDemo(Form_monitor frm) { InitializeComponent(); Icon ico = new Icon(Properties.Resources.Untitled_2, 64, 64); this.Icon = ico; form_monitor = frm; form_monitor.Hide(); this.WindowState = FormWindowState.Maximized; int W = Screen.FromHandle(form_monitor.Handle).Bounds.Width; int H = Screen.FromHandle(form_monitor.Handle).Bounds.Height; if (W > H) { Uri myUri = new Uri(Application.StartupPath + "/Images/mouseyo.swf"); webBrowser1.Navigate(myUri); } else { Uri myUri = new Uri(Application.StartupPath + "/Images/mouseyo_V.swf"); webBrowser1.Navigate(myUri); } }
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_monitor form_monitor; ClientStatus.Connect(); form_monitor = new Form_monitor(this); form_monitor.Show(); this.Hide(); }
public Form_Recognition(Form_monitor frm, Rectangle rect) { InitializeComponent(); Icon ico = new Icon(Properties.Resources.Untitled_2, 64, 64); this.Icon = ico; frm_Monitor = 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.Images.{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(); }