/// <summary> /// 磁贴控件 /// </summary> /// <param name="item"></param> /// <param name="tileMouseClick"></param> public Tile(Info.TileItem item, System.Windows.Forms.MouseEventHandler tileMouseClick) { Item = item; Size = new System.Drawing.Size(285, (285 - 8)/2); BackColor = item.BColor; BackgroundImage = item.PluginBg; BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; HLabel title = null; if (!item.Title.IsNullOrEmptyOrSpace()) { title = new HLabel( this, " " + item.Title, new System.Drawing.Font(BasePublic.KcpFrmFont, 14F), new System.Drawing.Size(Width, 28), new System.Drawing.Point(0, Height - 28), item.FColor, item.BColor, BaseAlign.AlignMiddleLeft, BaseAnchor.AnchorBottomFill ) { Cursor = System.Windows.Forms.Cursors.Hand }; title.MouseClick += tileMouseClick; } if (!item.LogoFontDesc.IsNullOrEmptyOrSpace() && item.LogoFontFamily != null) { var logo = new ELabel { Size = new System.Drawing.Size(Width, title == null ? (Width - 8) / 2 : (Width - 8) / 2 - title.Height), Location = new System.Drawing.Point(0, 0), Font = new System.Drawing.Font(item.LogoFontFamily, 45F), ForeColor = System.Drawing.Color.WhiteSmoke, Text = item.LogoFontDesc, Cursor = System.Windows.Forms.Cursors.Hand, TextAlign = BaseAlign.AlignMiddleCenter, BackColor = System.Drawing.Color.Transparent, Anchor = BaseAnchor.AnchorFill }; Controls.Add(logo); logo.MouseClick += tileMouseClick; } }
public RadioSigleBox( System.Windows.Forms.Control parentpal, string rdbtext, bool isChecked, bool single, string group, float fla, int flo, System.Drawing.Size size, System.Drawing.Point point, System.Drawing.Font font, System.Drawing.Color forecolor, System.Drawing.Color backcolor, System.Windows.Forms.AnchorStyles anchorstyle, System.Windows.Forms.MouseEventHandler touchRadio ) { Group = group; Single = single; Size = size; Location = point; Tag = Group; Value = rdbtext; Checked = isChecked; Radiotap = new HLabel ( this, isChecked ? @"þ" : @"¨", new System.Drawing.Font(@"Wingdings", fla), new System.Drawing.Size(size.Height - 6 - flo, size.Height), new System.Drawing.Point(0, 0), forecolor, backcolor, BaseAlign.AlignMiddleCenter, anchorstyle ); var radiodesc = new HLabel ( this, rdbtext, font, new System.Drawing.Size(size.Width - Radiotap.Width, size.Height), new System.Drawing.Point(Radiotap.Location.X + Radiotap.Width, -1), forecolor, backcolor, System.Drawing.ContentAlignment.MiddleLeft, anchorstyle ); Radiotap.MouseDown += touchRadio; radiodesc.MouseDown += touchRadio; CheckedChanged += RadioSigleBox_CheckedChanged; parentpal.Controls.Add(this); }