Пример #1
0
        // constructor
        public CustomToolTip(Control parent)
        {
            m_bDisposed = false;

            m_ToolTipWnd = new ToolTipNativeWindow(this);

            m_Parent  = parent;
            m_Font    = m_Parent.Font;
            m_Visible = false;

            m_Text = "";

            m_BackColor   = SystemColors.Info;
            m_BorderColor = SystemColors.ActiveBorder;
            m_ForeColor   = SystemColors.InfoText;
            m_Style       = ToolStyle.Flat;

            m_ShowTimer = new Timer();
            m_ShowTimer.Stop();
            m_ShowTimer.Interval = 2000;

            m_MaxWidth = 500;

            CreateToolTipWnd();

            m_ShowTimer.Tick += new EventHandler(m_ShowTimer_Tick);
        }
Пример #2
0
        void IWndProcProvider.WndProc(ref Message msg, ToolTipNativeWindow wnd)
        {
            switch ((WindowsMessages)msg.Msg)
            {
            case WindowsMessages.WM_PAINT:
                // paint if we get this message
                PaintToolTip(ref msg);
                break;

            default:
                // otherwise, let the default wndproc handle it
                wnd.DefWndProc(ref msg);
                break;
            }
        }