private async void VideoClick(object sender, MouseEventArgs e) { if (e.Clicks == 2) { clicked = false; PictureBox lab = (PictureBox)sender; string video = GetUri(lab); VideoForm vf = new VideoForm(video, lab.Height * 3, lab.Width * 3); vf.Show(); } else if (e.Clicks == 1) { if (clicked) { return; } clicked = true; await Task.Delay(SystemInformation.DoubleClickTime); if (!clicked) { return; } clicked = false; Label_Click(sender, e); } }
private void Picture_Click(object sender, EventArgs e) { if (sender is Label2) { Label2 lab = (Label2)sender; string video = lab.GetUrl(); VideoForm vf = new VideoForm(video); vf.Show(); } else { // int max = Screen.PrimaryScreen.WorkingArea.Height - 25; PictureBox pb = (PictureBox)sender; System.Drawing.Image img = pb.Image; PictureForm pf = new PictureForm(img); pf.Height = Sheight < img.Height ? (int)Sheight + 15 : img.Height; pf.Width = img.Width + 20; pf.Show(); } }