public void buzzido() { frmShatt pelea = new frmShatt(); if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate () { buzzido(); }); } else { Point mov = default(Point); Point def = default(Point); mov = def = this.Location; System.Media.SoundPlayer zumbido= new System.Media.SoundPlayer(Properties.Resources.buzzu); zumbido.Play(); // SystemSounds.Hand.Play(); for (int i = 0; i <= 500; i++) { for (int j = 0; j <= 4; j++) { switch (j) { case 0: mov.X = def.X + 10; mov.Y = def.Y + 10; break; case 1: mov.X = def.X - 10; mov.Y = def.Y - 10; break; case 2: mov.X = def.X + 10; mov.Y = def.Y - 10; break; case 3: mov.Y = def.X - 10; mov.Y = def.Y + 10; break; } this.Location = mov; } } this.Location = def; this.Refresh(); } }
private void PicChat_Click(object sender, EventArgs e) { frmShatt pto = new frmShatt(); pto.personal = false; pto.ShowDialog(); if (frmLogin.chato2 == "0") { Cliente = Encoding.ASCII.GetBytes("Logro%cgrup" + "%" + frmLogin.NomU + "%" + frmLogin.idU); server.Send(Cliente); MessageBox.Show("Nuevo logro!", "YEY", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void lvAmigos_SelectedIndexChanged(object sender, EventArgs e) { if (lvAmigos.SelectedItems.Count > 0) { NombreDeChat = lvAmigos.SelectedItems[0].SubItems[0].Text; frmShatt pto = new frmShatt(); lvAmigos.SelectedItems[0].UseItemStyleForSubItems = false; pto.lb_User2.Text = NombreDeChat; pto.lb_User.Text = frmLogin.NomU; pto.personal = true; pto.Show(); if (frmLogin.chato1 == "0") { frmMenu.Cliente = Encoding.ASCII.GetBytes("Logro%cind" + "%" + frmLogin.NomU + "%" + frmLogin.idU); frmMenu.server.Send(frmMenu.Cliente); MessageBox.Show("Nuevo logro!", "YEY", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }