System.Windows.Forms.CommandBar.NotifyCustomDraw C# (CSharp) Method

NotifyCustomDraw() private method

private NotifyCustomDraw ( Message &m ) : void
m Message
return void
        private void NotifyCustomDraw(ref Message m)
        {
            m.Result = (IntPtr) NativeMethods.CDRF_DODEFAULT;
            NativeMethods.LPNMTBCUSTOMDRAW tbcd = (NativeMethods.LPNMTBCUSTOMDRAW) m.GetLParam(typeof(NativeMethods.LPNMTBCUSTOMDRAW));

            switch (tbcd.nmcd.dwDrawStage)
            {
                case NativeMethods.CDDS_PREPAINT:
                    m.Result = (IntPtr) NativeMethods.CDRF_NOTIFYITEMDRAW;
                    break;

                case NativeMethods.CDDS_ITEMPREPAINT:
                    if (this.style == CommandBarStyle.Menu)
                    {
                        this.NotifyCustomDrawMenuBar(ref m);
                    }
                    if (this.style == CommandBarStyle.ToolBar)
                    {
                        this.NotifyCustomDrawToolBar(ref m);
                    }
                    break;
            }
        }