private void validationProvider1_ValidationFailed(object sender, ValidationFailedEventArgs e)
        {
            BaseEdit edit = e.InvalidControl as BaseEdit;

            if (edit == null)
            {
                return;
            }

            BaseEditViewInfo viewInfo = edit.GetViewInfo() as BaseEditViewInfo;

            if (viewInfo == null)
            {
                return;
            }

            if (edit.ToolTipController == null)
            {
                edit.ToolTipController = new ToolTipControllerDefault();
            }

            ToolTipControlInfo info = new ToolTipControlInfo(e.InvalidControl, e.ErrorText);

            info.ToolTipPosition = edit.PointToScreen(viewInfo.ErrorIconBounds.Location);

            edit.ToolTipController.InitialDelay = 0;
            edit.ToolTipController.ShowHint(info);
        }
示例#2
0
        public void ShowPopupForm()
        {
            Point location = _OwnerEdit.PointToScreen(new Point(0, 0));

            location.Y += _OwnerEdit.Height;
            Location    = location;
            Size        = new Size(_OwnerEdit.Width, 200);
            if (_attachedToParentForm)
            {
                Show(_OwnerEdit.FindForm());
            }
            else
            {
                Show();
            }
            Location = location;
        }