private void FRM_TMS_DASH_Load(object sender, EventArgs e) { // Access the Default ToolTipController. ToolTipController defController = ToolTipController.DefaultController; // Customize the controller's settings. defController.Appearance.BackColor = Color.AntiqueWhite; defController.ShowBeak = true; // Set a tooltip for the TextBox control. defController.SetToolTip(chartControl4, "Click vào đây để xem theo chuyến"); defController.SetToolTip(chartControl5, "Click vào đây để xem theo chuyến"); }
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 DisplayToolTip(Point p) { var info = GetGridHitInfo(p); if (info != null && _toolTipContainer.ContainsKey(info.RowHandle)) { _controller.SetToolTip(_control, _toolTipContainer[info.RowHandle]); } }
/// <summary> /// 显示清空请求头按钮说明 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleButton3_MouseEnter(object sender, EventArgs e) { ToolTipController toolTip = new ToolTipController(); toolTip.InitialDelay = 1000; toolTip.ReshowDelay = 1000; toolTip.ShowShadow = true; toolTip.SetToolTip(simpleButton3, "清空请求头"); }
private void MIDIPlaybackSpeedSlider_ValueChanged(object sender, EventArgs e) { midiPlaybackSpeed = MIDIPlaybackSpeedSlider.Value / 10.0; ToolTipController.SetToolTip((TrackBar)sender, midiPlaybackSpeed.ToString() + "x"); if (currentMidiFile != null) { currentMidiFile.MidiPlayback.Speed = midiPlaybackSpeed; } }
private void MIDIPlaybackTransposeSlider_ValueChanged(object sender, EventArgs e) { if (MIDIPlaybackTransposeSlider.Value > 0) { ToolTipController.SetToolTip((TrackBar)sender, $"+{MIDIPlaybackTransposeSlider.Value.ToString()} semitones"); } else { ToolTipController.SetToolTip((TrackBar)sender, $"{MIDIPlaybackTransposeSlider.Value.ToString()} semitones"); } midiTransposition = MIDIPlaybackTransposeSlider.Value; }
private void OctaveTranspositionSlider_ValueChanged(object sender, EventArgs e) { if (OctaveTranspositionSlider.Value > 0) { ToolTipController.SetToolTip((TrackBar)sender, $"+{OctaveTranspositionSlider.Value.ToString()} octaves"); } else { ToolTipController.SetToolTip((TrackBar)sender, $"{OctaveTranspositionSlider.Value.ToString()} octaves"); } noteLookupOctaveTransposition = 3 + OctaveTranspositionSlider.Value; BuildNoteDictionary(); }