public ButtonCtrl(VSlider p, IManipulator m) { CheckForIllegalCrossThreadCalls = false; parent = p; M = m; Size = new Size(parent.Width - 2 * DELTAX - 15, HEIGHT); BottomSize = new Size(Width, BOTTOM_HEIGHT); BackColor = Color.White; DoubleBuffered = false; bG = BufferedGraphicsManager.Current.Allocate(CreateGraphics(), ClientRectangle); bG.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; maniZone = new ManiZone(this); maniZone.MouseEnter += ButtonCtrl_MouseEnter; maniZone.MouseLeave += ButtonCtrl_MouseLeave; maniZone.MouseUp += ButtonCtrl_MouseUp; Controls.Add(maniZone); descreteZone = new DescreteZone(this); descreteZone.MouseEnter += ButtonCtrl_MouseEnter; descreteZone.MouseLeave += ButtonCtrl_MouseLeave; descreteZone.MouseUp += ButtonCtrl_MouseUp; descreteZone.Hide(); Controls.Add(descreteZone); MouseEnter += ButtonCtrl_MouseEnter; MouseLeave += ButtonCtrl_MouseLeave; MouseUp += ButtonCtrl_MouseUp; }
public SmallTBox(DescreteZone p, Func <string, bool> parsing, Func <string> get) { parent = p; parser = parsing; getvalue = get; AutoSize = false; TextAlign = HorizontalAlignment.Right; BorderStyle = BorderStyle.FixedSingle; Height = parent.Height - 2; Font = INPUT_FONT; KeyDown += CurrBox_KeyDown; LostFocus += SmallTBox_LostFocus; OnLostFocus(null); MouseEnter += parent.parent.ButtonCtrl_MouseEnter; MouseLeave += parent.parent.ButtonCtrl_MouseLeave; }