//------------------------------------------------------------------------------------- /// <summary> /// Отображает контрол во всплывающем контроле. /// </summary> /// <param name="screenPoint">Положение контрола в оконных координатах.</param> /// <param name="caption">Текст метки</param> /// <param name="value">Значение ввода</param> /// <param name="twoLines">Определяет отображение в две строки.</param> /// <param name="format">Формат ввода</param> /// <param name="formatException">Строка символов исключений формата.</param> /// <param name="width">Ширина</param> /// <returns></returns> public static SimQuickEdit ShowPopup(Point screenPoint, string caption, string value, bool twoLines, TextBoxFormat format = TextBoxFormat.NotSet, string formatException = "", int width = 170) { SimQuickEdit c = new SimQuickEdit(); c.Caption = caption; c.Value = value; c.TwoLines = twoLines; c.Format = format; c.FormatExceptions = formatException; c.ctrl.Width = width; c.Show(screenPoint); return c; }
protected override void OnMouseClick(MouseEventArgs e) { base.OnMouseClick(e); if(Image != null && e.Button == System.Windows.Forms.MouseButtons.Left && OnEditButtonClick() == false) { Rectangle r = this.ClientRectangle; r = new Rectangle(r.Width - this.Image.Width - this.Padding.Right - 6, 0, this.Image.Width + this.Padding.Right + 3, r.Height); if(r.Contains(e.Location)) { SimQuickEdit box = new SimQuickEdit(); box.Value = this.Text; box.Format = _format; box.FormatExceptions = _formatExceptions; box.InputDone += new Pulsar.EventHandler<SimQuickEdit, bool>(box_InputDone); Point pp = PointToScreen(new Point(this.Width - 1, this.Height - 2)); pp.X -= box.Width; box.Show(pp); } } }