/// <方法重写当鼠标移到控件时获取——ID> private void MouseEnter_reform(object send, EventArgs e) { SkinLabel button = (SkinLabel)send; //获取控件信息 this.SkinLabel_ID = button.Parent.ToString(); //写入信息 this.menuStrip_Reform.SkinContextMenuStrip_Button_ID = button.Name + button.Parent.ToString(); //写入信息 this.menuStrip_Reform.all_purpose = send; //获取事件触发的控件 }
// private string[] FromnamTexe = new string[] { "主画面", "手动画面", "异常画面", "监视画面", "运转画面", "生产设置", "参数设置" }; public Windowclass(Form Present, SkinButton[] Buttons, Form[] Formlist, SkinLabel Fromname, SkinButton skinButton) { for (int i = 0; i < Formlist.Length; i++) { if (Buttons[i].Name == skinButton.Name) { Fromtraverse(Present, Formlist[i], Buttons[i].Text); } } }
/// <summary> /// 绑定参数列表 /// </summary> private void BindPara() { // 清空所有控件 flp_Para.Controls.Clear(); string name = GetMethodNoteSel(selMethod); int y = 5; // 循环方法所需的所有参数 foreach (var item in selMethod.GetParameters()) { int x = 0; // 加载参数 SkinLabel paraName = new SkinLabel { Location = new Point(x, y + 2), TextAlign = ContentAlignment.MiddleRight, Size = new Size(80, 20), Text = item.Name + ":" }; paraName.MouseMove += Form_MouseDown; x += paraName.Size.Width + 5; // 加载文本框 SkinTextBox text = new SkinTextBox { Name = item.Name, Size = new Size(150, 20), Location = new Point(x, y), WaterText = GetNote(name, item.Name) }; x += text.Size.Width + 5; // 加载参数类型 SkinLabel paraType = new SkinLabel { Location = new Point(x, y + 2), TextAlign = ContentAlignment.MiddleLeft, Size = new Size(70, 20), Text = item.ParameterType.Name }; paraType.MouseMove += Form_MouseDown; y += 27; flp_Para.Controls.Add(paraName); flp_Para.Controls.Add(text); flp_Para.Controls.Add(paraType); } }
public Homepag_class(Form Homepage) { List <Profile> Quer = EF_HomepagQuery(); if (Quer.Count > 0) { PictureBox Profile_picture = (PictureBox)(from Control pi in Homepage.Controls where pi is PictureBox select pi).First(); SkinLabel Profile_Text = (SkinLabel)(from Control pi in Homepage.Controls where pi is SkinLabel select pi).First(); Profile_picture.Image = ReturnPhoto(Quer[indexes].Profilepicture); Profile_Text.Text = Quer[indexes].ProfilepictureText; } }
private void initEpisodes() { int count = int.Parse(bangumiInfo.data()["Count"]); int row = 0; for (int i = 0; i < count; i++) { if (i % 4 == 0 && i != 0) { row++; } Label eBlankGround = new Label(); PictureBox ePicture = new PictureBox(); SkinLabel eCountNumber = new SkinLabel(); SkinLabel eName = new SkinLabel(); eBlankGround.Location = new Point(0 + i % 4 * 230, 5 + row * 80); eBlankGround.Size = new Size(210, 60); //eBlankGround.Text = (count -1 - i).ToString(); ePicture.Location = new Point(0 + i % 4 * 230, 5 + row * 80); ePicture.Size = new Size(96, 60); ePicture.ImageLocation = (string)bangumiInfo.episodes()[count - 1 - i]["cover"]; ePicture.SizeMode = PictureBoxSizeMode.StretchImage; ePicture.InitialImage = Properties.Resources.loading; eName.ArtTextStyle = ArtTextStyle.None; eName.Location = new Point(105 + i % 4 * 230, 28 + row * 80); eName.Size = new Size(110, 35); eName.Text = (string)bangumiInfo.episodes()[count - 1 - i]["index_title"]; eName.Font = new Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); eCountNumber.ArtTextStyle = ArtTextStyle.None; eCountNumber.Location = new Point(105 + i % 4 * 230, 5 + row * 80); eCountNumber.Size = new Size(100, 25); eCountNumber.Text = "第 " + (i + 1).ToString() + " 集"; eCountNumber.Font = new Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.pageVideo.Controls.Add(eName); this.pageVideo.Controls.Add(eCountNumber); this.pageVideo.Controls.Add(ePicture); this.pageVideo.Controls.Add(eBlankGround); eBlankGround.Click += new EventHandler(toWebBangumi_Click); } }
private void Fromtraverse(Form Present, Form Openfrom, string Name) { foreach (Form frm in Application.OpenForms) //遍历所有窗口 { if (frm.Name == Openfrom.Name) //判断窗口是否打开 { frm.Activate(); //激活窗口 frm.WindowState = FormWindowState.Normal; //居中显示 return; //如果窗口已打开就放回方法 } } Openfrom.Show(); Openfrom.Text = Name; SkinLabel Label_Text = (SkinLabel)(from Control pi in Openfrom.Controls where pi is SkinLabel select pi).First(); Label_Text.Text = Name; }
public void Init(Dictionary <string, List <StepInfo> > infolist) { try { int txtheight = 16; int height = ParentForm.Size.Height / infolist.Count - txtheight; int icount = 0; foreach (var item in infolist) { SkinLabel tt = new SkinLabel(); tt.Location = new Point(0, icount * height + txtheight * icount); tt.Size = new Size(200, txtheight); tt.Text = item.Key; ParentForm.Controls.Add(tt); EXListView iTaskList = new EXListView(); ImageList image = new ImageList(); image.ImageSize = new Size(24, 24);//这边设置宽和高 iTaskList.SmallImageList = image; iTaskList.MySortBrush = SystemBrushes.ControlLight; iTaskList.MyHighlightBrush = Brushes.Goldenrod; iTaskList.GridLines = true; iTaskList.Location = new Point(0, icount * height + txtheight * (icount + 1)); iTaskList.Size = new Size(ParentForm.Size.Width, height - 3); iTaskList.ControlPadding = 4; int colwidth = (ParentForm.Size.Width) / (item.Value.Count + 4); iTaskList.Columns.Add(new EXEditableColumnHeader("内镜编号", colwidth)); iTaskList.Columns.Add(new EXEditableColumnHeader("内镜名称", colwidth)); iTaskList.Columns.Add(new EXEditableColumnHeader("洗消人员", colwidth)); iTaskList.Columns.Add(new EXEditableColumnHeader("消息", colwidth)); foreach (StepInfo info in item.Value) { iTaskList.Columns.Add(new EXColumnHeader(info.name, colwidth)); } TxtList.Add(item.Key, tt); TaskList.Add(item.Key, iTaskList); ParentForm.Controls.Add(iTaskList); icount++; } } catch (Exception ex) { LogHelper.WriteLog(typeof(Exception), ex); } }
public void SizeChange() { int icount = 0; int txtheight = 16; int height = ParentForm.Size.Height / TaskList.Count - txtheight; foreach (var item in TaskList) { SkinLabel tt = TxtList[item.Key]; tt.Location = new Point(0, icount * height + txtheight * icount); tt.Size = new Size(200, txtheight); EXListView iTaskList = item.Value; iTaskList.Location = new Point(0, icount * height + txtheight * (icount + 1)); iTaskList.Size = new Size(ParentForm.Size.Width, height - 3); int colwidth = (ParentForm.Size.Width) / iTaskList.Columns.Count - 1; foreach (ColumnHeader ch in iTaskList.Columns) { ch.Width = colwidth; } icount++; } }