예제 #1
0
        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");
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
        public void DisplayToolTip(Point p)
        {
            var info = GetGridHitInfo(p);

            if (info != null && _toolTipContainer.ContainsKey(info.RowHandle))
            {
                _controller.SetToolTip(_control, _toolTipContainer[info.RowHandle]);
            }
        }
예제 #4
0
        /// <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, "清空请求头");
        }
예제 #5
0
        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;
            }
        }
예제 #6
0
        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;
        }
예제 #7
0
        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();
        }