protected virtual void OnHeaderToolTip(ToolTipShowingEventArgs args) {
     if (this.HeaderToolTipShowing != null)
         this.HeaderToolTipShowing(this, args);
 }
        private void ApplyEventFormatting(ToolTipShowingEventArgs args) {
            if (!args.IsBalloon.HasValue &&
                !args.BackColor.HasValue &&
                !args.ForeColor.HasValue &&
                args.Title == null &&
                !args.StandardIcon.HasValue &&
                !args.AutoPopDelay.HasValue &&
                args.Font == null)
                return;

            this.PushSettings();
            if (args.IsBalloon.HasValue)
                this.IsBalloon = args.IsBalloon.Value;
            if (args.BackColor.HasValue)
                this.BackColor = args.BackColor.Value;
            if (args.ForeColor.HasValue)
                this.ForeColor = args.ForeColor.Value;
            if (args.StandardIcon.HasValue)
                this.StandardIcon = args.StandardIcon.Value;
            if (args.AutoPopDelay.HasValue)
                this.AutoPopDelay = args.AutoPopDelay.Value;
            if (args.Font != null)
                this.Font = args.Font;
            if (args.Title != null)
                this.Title = args.Title;
        }
 protected virtual void OnShowing(ToolTipShowingEventArgs e) {
     if (this.Showing != null)
         this.Showing(this, e);
 }
        /// <summary>
        /// Handle a get display info message
        /// </summary>
        /// <param name="msg">The msg</param>
        /// <returns>True if the message has been handled</returns>
        public virtual bool HandleGetDispInfo(ref Message msg) {
            //System.Diagnostics.Trace.WriteLine("HandleGetDispInfo");
            this.SetMaxWidth();
            ToolTipShowingEventArgs args = new ToolTipShowingEventArgs();
            args.ToolTipControl = this;
            this.OnShowing(args);
            if (String.IsNullOrEmpty(args.Text))
                return false;

            this.ApplyEventFormatting(args);

            NativeMethods.NMTTDISPINFO dispInfo = (NativeMethods.NMTTDISPINFO)msg.GetLParam(typeof(NativeMethods.NMTTDISPINFO));
            dispInfo.lpszText = args.Text;
            dispInfo.hinst = IntPtr.Zero;
            if (args.RightToLeft == RightToLeft.Yes)
                dispInfo.uFlags |= TTF_RTLREADING;
            Marshal.StructureToPtr(dispInfo, msg.LParam, false);

            return true;
        }