RadioDld.Main.TableToolbars_Resize C# (CSharp) Method

TableToolbars_Resize() private method

private TableToolbars_Resize ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void TableToolbars_Resize(object sender, EventArgs e)
        {
            if (this.WindowState != FormWindowState.Minimized)
            {
                this.TableToolbars.ColumnStyles[0] = new ColumnStyle(SizeType.Absolute, this.TableToolbars.Width - (this.ButtonHelpMenu.Rectangle.Width + this.ToolbarHelp.Margin.Right));
                this.TableToolbars.ColumnStyles[1] = new ColumnStyle(SizeType.Absolute, this.ButtonHelpMenu.Rectangle.Width + this.ToolbarHelp.Margin.Right);

                if (VisualStyleRenderer.IsSupported)
                {
                    // Visual styles are enabled, so draw the correct background behind the toolbars
                    Bitmap bmpBackground = new Bitmap(this.TableToolbars.Width, this.TableToolbars.Height);
                    Graphics graGraphics = Graphics.FromImage(bmpBackground);

                    try
                    {
                        VisualStyleRenderer vsrRebar = new VisualStyleRenderer("Rebar", 0, 0);
                        vsrRebar.DrawBackground(graGraphics, new Rectangle(0, 0, this.TableToolbars.Width, this.TableToolbars.Height));
                        this.TableToolbars.BackgroundImage = bmpBackground;
                    }
                    catch (ArgumentException)
                    {
                        // The 'Rebar' background image style did not exist, so don't try to draw it.
                    }
                }
            }
        }
Main