private void AvItemClick(object sender) { ResetPanel8(); PictureBox pb = (PictureBox)sender; AvItem av = (AvItem)pb.Parent.Parent; av.Panel.BackColor = Color.Blue; SetName(av.AvName, av.AvId); }
private void ResetPanel8() { var controls = panel8.Controls; foreach (var c in controls) { AvItem av = (AvItem)c; av.Panel.BackColor = Color.Empty; } }
private void ShowAv(List <AV> avs) { panel8.Controls.Clear(); var count = avs.Count; var outerWidth = panel8.Width - 10; var outerHeight = panel8.Height; var singleWidth = (int)(outerWidth / 3); var singleHeight = (int)(singleWidth / 1.5); int x = 2, y = 2; while (count > 0) { count -= 3; foreach (var av in avs.Take(3)) { AvItem item = new AvItem(av.Name, imageFolder + av.ID + av.Name + ".jpg", av.ID) { Width = singleWidth, Height = singleHeight, Location = new Point(x, y) }; item.AvItemClicked += new AvItem.AvItemClickHandle(avItemClicked); panel8.Controls.Add(item); x += singleWidth + 5; } x = 2; y += singleHeight + 2; avs = avs.Skip(3).ToList(); } if (panel8.Controls.Count > 0) { AvItemClick(panel8.Controls[0].Controls[1].Controls[0]); ConfirmMethod(); } }
private void AppendPostfix() { AvItem item = null; foreach (var control in panel8.Controls) { AvItem temp = (AvItem)control; if (temp.Panel.BackColor == Color.Blue) { item = temp; } } if (item != null) { AvItemClick(item.Controls[1].Controls[0]); StringBuilder sb = new StringBuilder(); if (cbChinese.Checked) { sb.Append("-C"); } if (rb0.Checked) { sb.Append(""); } if (rb1.Checked) { sb.Append("-1"); } if (rb2.Checked) { sb.Append("-2"); } if (rb3.Checked) { sb.Append("-3"); } if (rb4.Checked) { sb.Append("-4"); } if (rb5.Checked) { sb.Append("-5"); } if (rb6.Checked) { sb.Append("-6"); } targetText.Text = targetText.Text + sb.ToString(); } }