System.Windows.Forms.CommandBarManager.UpdateBand C# (CSharp) Method

UpdateBand() private method

private UpdateBand ( CommandBar commandBar ) : void
commandBar CommandBar
return void
        private void UpdateBand(CommandBar commandBar)
        {
            if (this.IsHandleCreated)
            {
                this.BeginUpdate();

                for (int i = 0; i < this.commandBars.Count; i++)
                {
                    NativeMethods.REBARBANDINFO rbbi = new NativeMethods.REBARBANDINFO();
                    rbbi.cbSize = Marshal.SizeOf(typeof(NativeMethods.REBARBANDINFO));
                    rbbi.fMask = NativeMethods.RBBIM_STYLE | NativeMethods.RBBIM_ID | NativeMethods.RBBIM_TEXT | NativeMethods.RBBIM_STYLE | NativeMethods.RBBIM_CHILD | NativeMethods.RBBIM_SIZE | NativeMethods.RBBIM_CHILDSIZE | NativeMethods.RBBIM_IDEALSIZE;
                    NativeMethods.SendMessage(this.Handle, NativeMethods.RB_GETBANDINFO, i, ref rbbi);

                    if (commandBar.Handle == rbbi.hwndChild)
                    {
                        if ((rbbi.cyMinChild != commandBar.Height) || (rbbi.cx != commandBar.Width) || (rbbi.cxIdeal != commandBar.Width))
                        {
                            rbbi.cyMinChild = commandBar.Height;
                            rbbi.cx = commandBar.Width;
             							rbbi.cxIdeal = commandBar.Width;
                            NativeMethods.SendMessage(this.Handle, NativeMethods.RB_SETBANDINFO, i, ref rbbi);
                        }
                    }
                }

                this.UpdateSize();

                this.EndUpdate();
            }
        }