public LPanel( System.Windows.Forms.Control parentpal, int lineint, System.Drawing.Size size, System.Drawing.Point point, System.Drawing.Color linecolor, System.Drawing.Color backcolor, System.Windows.Forms.AnchorStyles anchorstyle ) { var panelSec = new HPanel { Size = size, Location = point, Anchor = anchorstyle, BackColor = linecolor, }; Size = new System.Drawing.Size(panelSec.Size.Width - 2*lineint, panelSec.Size.Height - 2*lineint); Location = new System.Drawing.Point(lineint, lineint); BackColor = backcolor; Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom; panelSec.Controls.Add(this); parentpal.Controls.Add(panelSec); }
public LButton( System.Windows.Forms.Control parentpal, int lineint, string text, System.Drawing.Font font, System.Drawing.Size size, System.Drawing.Point point, System.Drawing.Color linecolor, System.Drawing.Color linelight, System.Drawing.Color backcolor, System.Drawing.Color backlight, System.Drawing.Color forecolor, System.Drawing.Color forelight, System.Windows.Forms.AnchorStyles anchorstyle ) { Linecolor = linecolor; Linelight = linelight; Backcolor = backcolor; Backlight = backlight; Forecolor = forecolor; Forelight = forelight; var panelSec = new HPanel { Size = size, Location = point, Anchor = anchorstyle, BackColor = linecolor, }; Text = text; Font = font; TextAlign = System.Drawing.ContentAlignment.MiddleCenter; Size = new System.Drawing.Size(panelSec.Size.Width - 2*lineint, panelSec.Size.Height - 2*lineint); Location = new System.Drawing.Point(lineint, lineint); ForeColor = Forecolor; BackColor = Backcolor; Anchor = System.Windows.Forms.AnchorStyles.Top; Cursor = System.Windows.Forms.Cursors.Hand; panelSec.Controls.Add(this); parentpal.Controls.Add(panelSec); MouseUp += LButton_MouseUp; MouseDown += LButton_MouseDown; MouseHover += LButton_MouseHover; MouseLeave += LButton_MouseLeave; }