protected virtual void OnToolTipChanged( ToolTipEventArgs e ) { if ( ToolTipChanged != null ) { ToolTipChanged( this, e ); } }
void ShowToolTip(object sender, ToolTipEventArgs args) { var tip = new TextBlock() .Append(Symbol.GetAccessibility() + Symbol.GetAbstractionModifier() + Symbol.GetSymbolKindName() + " ") .Append(Symbol.GetSignatureString(), true); ITypeSymbol t = Symbol.ContainingType; if (t != null) { tip.Append("\n" + t.GetSymbolKindName() + ": ") .Append(t.ToDisplayString(__MemberNameFormat)); } t = Symbol.GetReturnType(); if (t != null) { tip.Append("\nreturn value: " + t.ToDisplayString(__MemberNameFormat)); } tip.Append("\nnamespace: " + Symbol.ContainingNamespace?.ToString()) .Append("\nassembly: " + Symbol.GetAssemblyModuleName()); var f = Symbol as IFieldSymbol; if (f != null && f.IsConst) { tip.Append("\nconst: " + f.ConstantValue.ToString()); } var doc = Symbol.GetXmlDocSummaryForSymbol(); if (doc != null) { new XmlDocRenderer((SmartBar as CSharpSmartBar)._SemanticModel.Compilation, __Formatter).Render(doc, tip.Append("\n\n").Inlines); tip.MaxWidth = Config.Instance.QuickInfoMaxWidth; } tip.TextWrapping = TextWrapping.Wrap; ToolTip = tip; ToolTipService.SetShowDuration(this, 15000); ToolTipOpening -= ShowToolTip; }
async void Pin_ToolTipOpening(object sender, ToolTipEventArgs e) { if (IsToolTipLocationSet) { return; } Pin.ToolTip = "Finding Location..."; Location location = new Location(Coordinate.LatDecimal.Value, Coordinate.LonDecimal.Value); Task <LocationResult> t = Task.Factory.StartNew <LocationResult>(() => { return(BingMapsService.findLocation(location, BingMapsKey.SessionKey)); }); try { await t; if (t.Result != null) { Pin.ToolTip = t.Result.Name; IsToolTipLocationSet = true; } else { Pin.ToolTip = "Unknown location"; IsToolTipLocationSet = false; } } catch (Exception ex) { Pin.ToolTip = "Error: " + ex.Message; IsToolTipLocationSet = false; } }
private void chart1_GetToolTipText(object sender, ToolTipEventArgs e) { if (e.HitTestResult.ChartElementType == ChartElementType.DataPoint) { int i = e.HitTestResult.PointIndex; DataPoint dp = e.HitTestResult.Series.Points[i]; e.Text = "High: " + dp.YValues[0] + "\nLow: " + dp.YValues[1] + "\nOpen: " + dp.YValues[2] + "\nClose: " + dp.YValues[3]; } // gridline - 平行于Y chart1.ChartAreas[0].AxisX.StripLines[0].IntervalOffset = chart1.ChartAreas[0].AxisX.PixelPositionToValue(e.X); int j = (int)Math.Round(chart1.ChartAreas[0].AxisX.PixelPositionToValue(e.X)); chart1.ChartAreas[0].AxisX.StripLines[0].Text = j.ToString(); //chart1.ChartAreas[0].AxisX.StripLines.Text = chart1.Series["Daily"].Points[j].XValue.ToString(); #值一直为0 // 平行于X chart1.ChartAreas[0].AxisY.StripLines[0].IntervalOffset = chart1.ChartAreas[0].AxisY.PixelPositionToValue(e.Y); chart1.ChartAreas[0].AxisY.StripLines[0].Text = Math.Round(chart1.ChartAreas[0].AxisY.PixelPositionToValue(e.Y), 3).ToString(); }
private void chart1_GetToolTipText(object sender, ToolTipEventArgs e) { if (!String.IsNullOrWhiteSpace(e.Text)) { return; } Console.WriteLine(e.HitTestResult.ChartElementType); switch (e.HitTestResult.ChartElementType) { case ChartElementType.DataPoint: case ChartElementType.DataPointLabel: case ChartElementType.Gridlines: case ChartElementType.Axis: case ChartElementType.TickMarks: case ChartElementType.PlottingArea: var area = chart1.ChartAreas[0]; var areaPosition = area.Position; var areaRect = new RectangleF(areaPosition.X * chart1.Width / 100, areaPosition.Y * chart1.Height / 100, areaPosition.Width * chart1.Width / 100, areaPosition.Height * chart1.Height / 100); var innerPlot = area.InnerPlotPosition; double x = area.AxisX.Minimum + (area.AxisX.Maximum - area.AxisX.Minimum) * (e.X - areaRect.Left - innerPlot.X * areaRect.Width / 100) / (innerPlot.Width * areaRect.Width / 100); double y = area.AxisY.Maximum - (area.AxisY.Maximum - area.AxisY.Minimum) * (e.Y - areaRect.Top - innerPlot.Y * areaRect.Height / 100) / (innerPlot.Height * areaRect.Height / 100); if (comboBox5.SelectedIndex == 1) { y = Math.Round(y, 0); } x = Math.Round(x, 0); textBox1.Text = $"{x:F2} {y:F2}"; //Console.WriteLine("{0:F2} {1:F2}", x, y); if (comboBox3.SelectedIndex != 0) { e.Text = String.Format("{0:F2} {1:F2}", x, y); } else { if (x > 0 && x < 13) { e.Text = String.Format("{0:F2} {1:F2}", month[int.Parse((x - 1).ToString())], y); } } break; } }
void SpellBlockLink_ToolTipOpening(object sender, ToolTipEventArgs e) { Hyperlink l = (Hyperlink)sender; ((ToolTip)l.ToolTip).DataContext = l.Tag; }
private void UserControl_ToolTipOpening(object sender, ToolTipEventArgs e) { var b = sender as AssignmentView; b.ToolTip = b.Description.Text + "\n" + b.Duration.Text + "\n" + b.Location.Text; }
private void MovieTitle_Tab_ToolTipOpening(object sender, ToolTipEventArgs e) { this.ToolTip = MovieTitleText; }
private void m_Def_ToolTipChanged(object sender, ToolTipEventArgs e) { Pandora.ToolTip.SetToolTip( this, e.Text ); }
private void button_Time_Tooltip(Button btn, ToolTipEventArgs e, int mode) { e.Handled = !btn.IsEnabled; btn.ToolTip = MoveTimeTarget(mode).ConvertText(DateTime.MaxValue); }
private void chart1_GetToolTipText(object sender, ToolTipEventArgs e) { }
private void FileItem_ToolTipOpening(object sender, ToolTipEventArgs e) { // Update the tool tip info each time it's shown sender.CastTo <ListBoxItem>().GetBindingExpression(ToolTipProperty)?.UpdateTarget(); }
protected override void OnToolTipOpening(ToolTipEventArgs e) { base.OnToolTipOpening(e); EnsureToolTipContent(); }
private static void PDFDocumentNodeContentControl_ToolTipOpening(object sender, ToolTipEventArgs e) { TextBlock text_block = (TextBlock)sender; DocumentTextBlockTag tag = (DocumentTextBlockTag)text_block.Tag; try { if (null == tag.library_index_hover_popup) { tag.library_index_hover_popup = new LibraryIndexHoverPopup(); tag.library_index_hover_popup.SetPopupContent(tag.pdf_document, 1); text_block.ToolTip = tag.library_index_hover_popup; } } catch (Exception ex) { Logging.Error(ex, "Exception while displaying document preview popup"); } }
private static void PDFDocumentNodeContentControl_ToolTipClosing(object sender, ToolTipEventArgs e) { TextBlock text_block = (TextBlock)sender; DocumentTextBlockTag tag = (DocumentTextBlockTag)text_block.Tag; tag.library_index_hover_popup?.Dispose(); tag.library_index_hover_popup = null; text_block.ToolTip = ""; }
private void OnViewItems_ToolTipOpening(object sender, ToolTipEventArgs e) { m_viewItems.ToolTip = m_viewItems.Items.Count.ToString() + " items"; }
/// <summary> /// Handles the event that occurs when a tool tip is about to be displayed. /// </summary> /// <param name="sender">Event source</param> /// <param name="e">Event arguements</param> protected new void ToolTipOpening(object sender, ToolTipEventArgs e) { // overwrite tool tip with that one of the route ToolTip = Route.ToolTip; }
private void chart_GetToolTipText(object aSender, ToolTipEventArgs aEventArgs) { aEventArgs.Text = mLabelText; }
private void DgContactPersons_ToolTipOpening(object sender, ToolTipEventArgs e) { }
private void SkillIconControl_OnToolTipClosing(object sender, ToolTipEventArgs e) { FocusManager.PauseTopmost = false; }
public void DateTooltip(object sender, ToolTipEventArgs e) { (sender as FrameworkElement).ToolTip = GetDate().ConvertText(DateTime.MaxValue); }
private void DistanceChart1_GetToolTipText(object sender, ToolTipEventArgs e) { DistanceChart1.Series["D1"].ToolTip = "Mag: #VALY, D1: #VALX"; DistanceChart1.Series["D2"].ToolTip = "Mag: #VALY, D2: #VALX"; }
private void OnToolTipOpening(object sender, ToolTipEventArgs e) { WpfUtils.OnToolTipOpening(sender, e); }
private void OnShowToolTip(object sender, ToolTipEventArgs e) { if (!_ribbon.IsDisposed) { // Do not show tooltips when the form we are in does not have focus Form topForm = _ribbon.FindForm(); if ((topForm != null) && !topForm.ContainsFocus) { return; } // Never show tooltips are design time if (!_ribbon.InDesignMode) { IContentValues sourceContent = null; LabelStyle toolTipStyle = LabelStyle.SuperTip; Rectangle screenRect = new Rectangle(e.ScreenPt, new Size(1, 1)); // If the target is the application button if ((e.Target is ViewLayoutRibbonAppButton) || (e.Target is ViewLayoutRibbonAppTab)) { // Create a content that recovers values from a the ribbon for the app button/tab AppButtonToolTipToContent appButtonContent = new AppButtonToolTipToContent(_ribbon); // Is there actually anything to show for the tooltip if (appButtonContent.HasContent) { sourceContent = appButtonContent; // Grab the style from the app button settings toolTipStyle = _ribbon.RibbonAppButton.AppButtonToolTipStyle; // Display below the mouse cursor screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2; } } else { // If the target is a QAT button if (e.Target is ViewDrawRibbonQATButton) { // Cast to correct type ViewDrawRibbonQATButton viewElement = (ViewDrawRibbonQATButton)e.Target; // Create a content that recovers values from a IQuickAccessToolbarButton QATButtonToolTipToContent qatButtonContent = new QATButtonToolTipToContent(viewElement.QATButton); // Is there actually anything to show for the tooltip if (qatButtonContent.HasContent) { sourceContent = qatButtonContent; // Grab the style from the QAT button settings toolTipStyle = viewElement.QATButton.GetToolTipStyle(); // Display below the mouse cursor screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2; } } else { // If the target is a label if ((e.Target.Parent != null) && (e.Target.Parent is ViewDrawRibbonGroupLabel)) { // Cast to correct type ViewDrawRibbonGroupLabel viewElement = (ViewDrawRibbonGroupLabel)e.Target.Parent; // Create a content that recovers values from a KryptonRibbonGroupItem GroupItemToolTipToContent groupItemContent = new GroupItemToolTipToContent(viewElement.GroupLabel); // Is there actually anything to show for the tooltip if (groupItemContent.HasContent) { sourceContent = groupItemContent; // Grab the style from the group label settings toolTipStyle = viewElement.GroupLabel.ToolTipStyle; // Display below the bottom of the ribbon control Rectangle ribbonScreenRect = _ribbon.ToolTipScreenRectangle; screenRect.Y = ribbonScreenRect.Y; screenRect.Height = ribbonScreenRect.Height; screenRect.X = ribbonScreenRect.X + viewElement.ClientLocation.X; screenRect.Width = viewElement.ClientWidth; } } else { // Is the target is a button or cluster button if (e.Target is ViewDrawRibbonGroupButtonBackBorder) { // Cast to correct type ViewDrawRibbonGroupButtonBackBorder viewElement = (ViewDrawRibbonGroupButtonBackBorder)e.Target; // Create a content that recovers values from a KryptonRibbonGroupItem GroupItemToolTipToContent groupItemContent = new GroupItemToolTipToContent(viewElement.GroupItem); // Is there actually anything to show for the tooltip if (groupItemContent.HasContent) { sourceContent = groupItemContent; // Grab the style from the group button/group cluster button settings toolTipStyle = viewElement.GroupItem.InternalToolTipStyle; // Display below the bottom of the ribbon control Rectangle ribbonScreenRect = _ribbon.ToolTipScreenRectangle; screenRect.Y = ribbonScreenRect.Y; screenRect.Height = ribbonScreenRect.Height; screenRect.X = ribbonScreenRect.X + viewElement.ClientLocation.X; screenRect.Width = viewElement.ClientWidth; } } else { if (e.Target is ViewLayoutRibbonCheckBox) { // Cast to correct type ViewDrawRibbonGroupCheckBox viewElement = (ViewDrawRibbonGroupCheckBox)e.Target.Parent; // Create a content that recovers values from a KryptonRibbonGroupItem GroupItemToolTipToContent groupItemContent = new GroupItemToolTipToContent(viewElement.GroupCheckBox); // Is there actually anything to show for the tooltip if (groupItemContent.HasContent) { sourceContent = groupItemContent; // Grab the style from the group check box cluster button settings toolTipStyle = viewElement.GroupCheckBox.InternalToolTipStyle; // Display below the bottom of the ribbon control Rectangle ribbonScreenRect = _ribbon.ToolTipScreenRectangle; screenRect.Y = ribbonScreenRect.Y; screenRect.Height = ribbonScreenRect.Height; screenRect.X = ribbonScreenRect.X + viewElement.ClientLocation.X; screenRect.Width = viewElement.ClientWidth; } } else { if (e.Target is ViewLayoutRibbonRadioButton) { // Cast to correct type ViewDrawRibbonGroupRadioButton viewElement = (ViewDrawRibbonGroupRadioButton)e.Target.Parent; // Create a content that recovers values from a KryptonRibbonGroupItem GroupItemToolTipToContent groupItemContent = new GroupItemToolTipToContent(viewElement.GroupRadioButton); // Is there actually anything to show for the tooltip if (groupItemContent.HasContent) { sourceContent = groupItemContent; // Grab the style from the group radio button button settings toolTipStyle = viewElement.GroupRadioButton.InternalToolTipStyle; // Display below the bottom of the ribbon control Rectangle ribbonScreenRect = _ribbon.ToolTipScreenRectangle; screenRect.Y = ribbonScreenRect.Y; screenRect.Height = ribbonScreenRect.Height; screenRect.X = ribbonScreenRect.X + viewElement.ClientLocation.X; screenRect.Width = viewElement.ClientWidth; } } else { // Find the button spec associated with the tooltip request ButtonSpec buttonSpec = _buttonManager.ButtonSpecFromView(e.Target); // If the tooltip is for a button spec if (buttonSpec != null) { // Are we allowed to show page related tooltips if (_ribbon.AllowButtonSpecToolTips) { // Create a helper object to provide tooltip values ButtonSpecToContent buttonSpecMapping = new ButtonSpecToContent(_ribbon.GetRedirector(), buttonSpec); // Is there actually anything to show for the tooltip if (buttonSpecMapping.HasContent) { sourceContent = buttonSpecMapping; // Grab the style from the button spec settings toolTipStyle = buttonSpec.ToolTipStyle; // Display below the mouse cursor screenRect.Height += SystemInformation.CursorSize.Height / 3 * 2; } } } } } } } } } if (sourceContent != null) { // Remove any currently showing tooltip _visualPopupToolTip?.Dispose(); // Create the actual tooltip popup object _visualPopupToolTip = new VisualPopupToolTip(_ribbon.GetRedirector(), sourceContent, _ribbon.Renderer, PaletteBackStyle.ControlToolTip, PaletteBorderStyle.ControlToolTip, CommonHelper.ContentStyleFromLabelStyle(toolTipStyle)); _visualPopupToolTip.Disposed += new EventHandler(OnVisualPopupToolTipDisposed); // The popup tooltip control always adds on a border above/below so we negate that here. screenRect.Height -= 20; // Show relative to the provided screen rectangle _visualPopupToolTip.ShowCalculatingSize(screenRect); } } } }
private void SkillIconControl_OnToolTipOpening(object sender, ToolTipEventArgs e) { FocusManager.PauseTopmost = true; }
private void ChainedEventCheckBox_OnToolTipOpening(object sender, ToolTipEventArgs e) { e.Handled = true; }
protected void link_ToolTipOpening(object sender, ToolTipEventArgs e) { Hyperlink l = (Hyperlink)sender; ((ToolTip)l.ToolTip).DataContext = l.DataContext; }
private void ShowToolTip(object sender, ToolTipEventArgs e) { }
private void ChangeToolTipContent(object sender, ToolTipEventArgs e) { ToolTip = "1234567890"; }
private void SkillIconControl_OnToolTipOpening(object sender, ToolTipEventArgs e) { FocusManager.Running = false; }
private void Hyperlink_ToolTipOpening(object sender, ToolTipEventArgs e) { e.Handled = true; LongUrlService.HyperlinkToolTipOpeningHandler(sender, e); }
private void SkillIconControl_OnToolTipClosing(object sender, ToolTipEventArgs e) { FocusManager.Running = true; }