protected override void CheckMouseCursor(LookUpPopupHitTest ht) { if (prevPoint.X != ht.Point.X || prevPoint.Y != ht.Point.Y) { prevPoint = ht.Point; LookUpEditHints le = this.OwnerEdit as LookUpEditHints; LookUpColumnInfo column; int columnPos = -1; for (int i = 0; i < this.OwnerEdit.Properties.Columns.Count; i++) { column = this.OwnerEdit.Properties.Columns[i]; if (column.FieldName == le.Properties.DescriptionField) { columnPos = i; break; } } if (columnPos != -1) { if (ht.HitType == LookUpPopupHitType.Row) { if (ht.Index != prevRowIndex) { tt.HideHint(); prevRowIndex = ht.Index; } tt.ShowHint(dt.Rows[ht.Index][columnPos].ToString()); } } } base.CheckMouseCursor(ht); }
public static void ShowTip(this Control ctl, string content, ToolTipLocation tipLocation = ToolTipLocation.BottomCenter, ToolTipType toolTipType = ToolTipType.Standard, int showTime = 2000, bool isAutoHide = true, ToolTipIconType tipIconType = ToolTipIconType.Application, ImageList imgList = null, int imgIndex = 0) { try { var myToolTipClt = new ToolTipController(); ToolTipControllerShowEventArgs args = myToolTipClt.CreateShowArgs(); myToolTipClt.ImageList = imgList; myToolTipClt.ImageIndex = (imgList == null ? 0 : imgIndex); args.AutoHide = isAutoHide; myToolTipClt.Appearance.BackColor = Color.FromArgb(254, 254, 254); myToolTipClt.ShowBeak = true; myToolTipClt.AllowHtmlText = true; myToolTipClt.ShowShadow = true; myToolTipClt.Rounded = true; myToolTipClt.AutoPopDelay = (showTime == 0 ? 2000 : showTime); myToolTipClt.SetToolTip(ctl, content); myToolTipClt.SetToolTipIconType(ctl, tipIconType); myToolTipClt.Active = true; myToolTipClt.ToolTipType = toolTipType; myToolTipClt.HideHint(); myToolTipClt.ShowHint(content, null, ctl, tipLocation); } catch (Exception ex) { LogUtil.WriteException(ex); } }
public void HideHint(bool clearCurrentObject, ToolTipController toolTipController) { if (clearCurrentObject) { _editObject = null; } toolTipController.HideHint(); _hintIsShown = false; }
/// <summary> /// 自定义ChartControl的Tooltip /// </summary> /// <param name="chart">ChartControl</param> /// <param name="e">MouseEventArgs</param> /// <param name="tooltip">ToolTipController</param> /// <param name="tooltipTitle">ToolTipController的Title</param> /// <param name="paramter">委托</param> public static void CustomToolTip(this ChartControl chart, MouseEventArgs e, ToolTipController tooltip, string tooltipTitle, System.Func <string, double[], string> paramter) { ChartHitInfo _hitInfo = chart.CalcHitInfo(e.X, e.Y); SeriesPoint _point = _hitInfo.SeriesPoint; if (_point != null) { string _msg = paramter(_point.Argument, _point.Values); tooltip.ShowHint(_msg, tooltipTitle); } else { tooltip.HideHint(); } }
public static bool ValidarCampoVacio(ComboBoxEdit cmb, string mensaje, ToolTipController tooltip) { bool flag; if (string.IsNullOrEmpty(cmb.Text)) { tooltip.HideHint(); tooltip.ShowHint(mensaje, cmb, DevExpress.Utils.ToolTipLocation.LeftTop); flag = true; } else { flag = false; } return(flag); }
/// <summary> /// ChartControl的Tooltip设置 /// <para>举例</para> /// <code> /// <para> chartControl1.SetToolTip(toolTipController1, "交易详情", (agr, values) =></para> /// <para>{</para> /// <para> return string.Format("时间:{0}\r\n金额:{1}", agr, values[0]);</para> /// <para>});</para> /// </code> /// </summary> /// <param name="chart">ChartControl</param> /// <param name="tooltip">ToolTipController</param> /// <param name="tooltipTitle">ToolTip的Title</param> /// <param name="paramter">委托,参数『Argument,Values』</param> public static void SetToolTip(this ChartControl chart, ToolTipController tooltip, string tooltipTitle, System.Func <string, double[], string> paramter) { chart.MouseMove += (sender, e) => { ChartControl _curChart = sender as ChartControl; ChartHitInfo _hitInfo = _curChart.CalcHitInfo(e.X, e.Y); SeriesPoint _point = _hitInfo.SeriesPoint; if (_point != null) { string _msg = paramter(_point.Argument, _point.Values); tooltip.ShowHint(_msg, tooltipTitle); } else { tooltip.HideHint(); } }; }
/// <summary> /// ToolTip消息提示 /// </summary> /// <param name="title">标题</param> /// <param name="content">内容</param> /// <param name="showTime">显示时长</param> /// <param name="isAutoHide">自动隐藏</param> public static void NewToolTip(string title, string content, int showTime, bool isAutoHide) { try { MyToolTipClt = new ToolTipController(); args = MyToolTipClt.CreateShowArgs(); title = string.IsNullOrEmpty(title) ? "温馨提示" : title; args.AutoHide = isAutoHide; MyToolTipClt.ShowBeak = true; MyToolTipClt.ShowShadow = true; MyToolTipClt.Rounded = true; MyToolTipClt.AutoPopDelay = (showTime == 0 ? 2000 : showTime); MyToolTipClt.Active = true; MyToolTipClt.HideHint(); MyToolTipClt.ShowHint(content, title, Control.MousePosition); } catch (Exception ex) { throw ex; } }
private void hideToolTip(HotTrackEventArgs e) { e.Cancel = true; ToolTipController.HideHint(); }
private void chartControl1_MouseLeave(object sender, EventArgs e) { toolTipController.HideHint(); }
public void HideHint(bool clearCurrentObject, ToolTipController toolTipController) { if (clearCurrentObject) _editObject = null; toolTipController.HideHint(); _hintIsShown = false; }
void HideHint(object sender, EventArgs eventArgs) { _toolTipController.HideHint(); }
private void _MouseMove(object sender, MouseEventArgs e) { ChartControl chartControl_current = null; ChartHitInfo hitInfo = null; foreach (Control c in xtraTabControl1.TabPages) { if (c is XtraTabPage && ((XtraTabPage)c).Name == "xtraTabPage3") { foreach (Control b in c.Controls) { if (b is ChartControl && ((ChartControl)b).Equals(sender)) { chartControl_current = ((ChartControl)b); hitInfo = chartControl_current.CalcHitInfo(e.Location); } } } } foreach (Control c in xtraTabControl1.TabPages) { if (c is XtraTabPage && ((XtraTabPage)c).Name == "limitAverageXTP") { foreach (Control b in c.Controls) { if (b is ChartControl && ((ChartControl)b).Equals(sender)) { chartControl_current = ((ChartControl)b); hitInfo = chartControl_current.CalcHitInfo(e.Location); } } } } if (hitInfo == null) { return; } StringBuilder builder = new StringBuilder(); if (hitInfo.InDiagram) { builder.AppendLine("In diagram"); } if (hitInfo.InNonDefaultPane) { builder.AppendLine("In non-default pane: " + hitInfo.NonDefaultPane.Name); } if (hitInfo.InAxis) { builder.AppendLine("In axis: " + hitInfo.Axis.Name); if (hitInfo.AxisLabelItem != null) { builder.AppendLine(" Label item: " + hitInfo.AxisLabelItem.Text); } if (hitInfo.AxisTitle != null) { builder.AppendLine(" Axis title: " + hitInfo.AxisTitle.Text); } } if (hitInfo.InChartTitle) { builder.AppendLine("In chart title: " + hitInfo.ChartTitle.Text); } if (hitInfo.InLegend) { builder.AppendLine("In legend"); } if (hitInfo.InSeries) { builder.AppendLine("In series: " + ((Series)hitInfo.Series).Name); } if (hitInfo.InSeriesLabel) { builder.AppendLine("In series label"); builder.AppendLine(" Series: " + ((Series)hitInfo.Series).Name); } if (hitInfo.SeriesPoint != null) { builder.AppendLine(" Argument: " + hitInfo.SeriesPoint.Argument); if (!hitInfo.SeriesPoint.IsEmpty) { builder.AppendLine(" Value: " + hitInfo.SeriesPoint.Values[0]); } } if (builder.Length > 0) { toolTipController.ShowHint("AIO-testing results:\n" + builder.ToString(), chartControl_current.PointToScreen(e.Location)); } else { toolTipController.HideHint(); } }
public static void MostrarMensajeCampoVacio(TextEdit txt, string mensaje, ToolTipController tooltip) { tooltip.HideHint(); tooltip.ShowHint(mensaje, txt, DevExpress.Utils.ToolTipLocation.LeftTop); }
public static bool ValidarCampoVacio(ComboBoxEdit cmb, string mensaje, ToolTipController tooltip) { bool flag; if (string.IsNullOrEmpty(cmb.Text)) { tooltip.HideHint(); tooltip.ShowHint(mensaje, cmb, DevExpress.Utils.ToolTipLocation.LeftTop); flag = true; } else { flag = false; } return flag; }
public static void MostrarMensajeCampoVacio(TextEdit txt, string mensaje, ToolTipController tooltip) { tooltip.HideHint(); tooltip.ShowHint(mensaje, txt, DevExpress.Utils.ToolTipLocation.LeftTop); }