当前位置: 首页>>代码示例>>C#>>正文


C# Panel.SetDoubleBuffered方法代码示例

本文整理汇总了C#中System.Windows.Forms.Panel.SetDoubleBuffered方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.SetDoubleBuffered方法的具体用法?C# Panel.SetDoubleBuffered怎么用?C# Panel.SetDoubleBuffered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Panel的用法示例。


在下文中一共展示了Panel.SetDoubleBuffered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateArgumentPanel

            /// <summary>
            /// Helper Method to create an Argument Panel out of a Label and a Control. Such an 'Argument Panel'
            /// can be passed to the TUcoFilterAndFind UserControl.
            /// </summary>
            /// <param name="AControlLabel">Label of the Argument Control.
            /// If this is null, no Label will be shown (useful e.g. for CheckBox Controls who have their own
            /// 'attached' Label).</param>
            /// <param name="AControl">Argument Control.</param>
            /// <param name="AAutomaticClearButton">Whether to automatically create an 'Clear Value' Button (default=true).</param>
            /// <returns>An Argument Panel that can be passed to the TUcoFilterAndFind UserControl.</returns>
            public static Panel CreateArgumentPanel(Label AControlLabel, Control AControl, bool AAutomaticClearButton = true)
            {
                const int ARGUMENT_PANEL_BOTTOM_BORDER = 6; // in Pixels;
                int NextControlVPos = 0;
                Panel ArgumentPanel = new Panel();

                if (AControl == null)
                {
                    throw new ArgumentNullException("Argument AControl must not be null");
                }

                if (AControlLabel != null)
                {
                    AControlLabel.Location = new System.Drawing.Point(3, 0);
                    AControlLabel.AutoSize = true;
                    AControlLabel.Font = new System.Drawing.Font("Verdana", 7F);
                    AControlLabel.TabIndex = 0;

                    NextControlVPos = 17;
                }

                AControl.Location = new System.Drawing.Point(3, NextControlVPos);
                AControl.TabIndex = 1;

                if (!AAutomaticClearButton)
                {
                    ArgumentPanel.Tag = CommonTagString.ARGUMENTPANELTAG_NO_AUTOM_ARGUMENTCLEARBUTTON;
                }

                if (!(AControl is CheckBox))
                {
                    ArgumentPanel.Height = AControl.Bottom + ARGUMENT_PANEL_BOTTOM_BORDER;
                }
                else
                {
                    ArgumentPanel.Height = AControl.Bottom + 3;
                    AControl.Font = new System.Drawing.Font("Verdana", 7F);  // for the Label that is part of the CheckBox Control!
                }

                if (AControlLabel != null)
                {
                    ArgumentPanel.Controls.Add(AControlLabel);
                }

                ArgumentPanel.Controls.Add(AControl);

                ArgumentPanel.BackColor = System.Drawing.Color.Teal;
                ArgumentPanel.SetDoubleBuffered(true);


                return ArgumentPanel;
            }
开发者ID:Davincier,项目名称:openpetra,代码行数:62,代码来源:ucoFilterAndFind.cs

示例2: AddTabs

        private void AddTabs()
        {
            Panel pnlFindOptions = new Panel();
            Button btnFindNext = new Button();
            GroupBox grpFindDirection = new GroupBox();
            RadioButton rbtFindDirUp = new RadioButton();
            RadioButton rbtFindDirDown = new RadioButton();
            TSingleLineFlow LayoutManagerFindControls;
            TSingleLineFlow LayoutManagerFilterTab;
            TSingleLineFlow LayoutManagerFindTab;

            this.SuspendLayout();
            grpFindDirection.SuspendLayout();
            pnlFindOptions.SuspendLayout();
            FTabFilterAndFind.SuspendLayout();

            FPnlFindControls = new Owf.Controls.A1Panel();
            FPnlFindControls.SuspendLayout();
            FPnlFindControls.Name = "FPnlFindControls";
            FPnlFindControls.Left = 7;
            FPnlFindControls.Top = 8;
            FPnlFindControls.Width = FInitialWidth - 5;
            FPnlFindControls.Height = 174;
            FPnlFindControls.BorderColor = System.Drawing.Color.CadetBlue;
            FPnlFindControls.ShadowOffSet = 4;
            FPnlFindControls.RoundCornerRadius = 4;
            FPnlFindControls.GradientDirection = LinearGradientMode.Horizontal;

            // Layout Manager for the 'Find' Panel.
            // This will arrange 'Argument Panels' that will be added later to the 'Find' Panel.
            LayoutManagerFindControls = new TSingleLineFlow(FPnlFindControls, 4, 3);
            LayoutManagerFindControls.TopMargin = 5;
            LayoutManagerFindControls.RightMargin = 9;
            LayoutManagerFindControls.SpacerDistance = 3;

            btnFindNext.Top = 2;
            btnFindNext.Left = 1;
            btnFindNext.Text = "Find Ne&xt";
            btnFindNext.Name = "btnFindNext";
            btnFindNext.BackColor = System.Drawing.SystemColors.ButtonFace;
            btnFindNext.ImageList = imlButtonIcons;
            btnFindNext.ImageIndex = 4;
            btnFindNext.ImageAlign = ContentAlignment.MiddleRight;
            btnFindNext.Click += delegate(object sender, EventArgs e) {
                OnFindNextClicked(sender, e);
            };

            tipGeneral.SetToolTip(btnFindNext, "Click to find the next occurance\r\nin the search direction");

            rbtFindDirUp.Top = 14;
            rbtFindDirUp.Left = 10;
            rbtFindDirUp.AutoSize = true;
            rbtFindDirUp.Name = "rbtFindDirUp";
            rbtFindDirUp.Text = Catalog.GetString("&Up");
            rbtFindDirUp.Tag = CommonTagString.SUPPRESS_CHANGE_DETECTION;

            rbtFindDirDown.Top = 14;
            rbtFindDirDown.Left = 60;
            rbtFindDirDown.AutoSize = true;
            rbtFindDirDown.Checked = true;
            rbtFindDirDown.Name = "rbtFindDirDown";
            rbtFindDirDown.Text = Catalog.GetString("D&own");
            rbtFindDirDown.Tag = CommonTagString.SUPPRESS_CHANGE_DETECTION;

            grpFindDirection.Top = 30;
            grpFindDirection.Left = 3;
            grpFindDirection.Height = 38;
            grpFindDirection.BackColor = System.Drawing.Color.Transparent;
            grpFindDirection.Name = "grpFindDirection";
            grpFindDirection.Text = "Direction";
            grpFindDirection.Controls.Add(rbtFindDirUp);
            grpFindDirection.Controls.Add(rbtFindDirDown);

            pnlFindOptions.Name = "pnlFindOptions";
            pnlFindOptions.Left = 0;
            pnlFindOptions.Width = FTabFilterAndFind.Width;
            pnlFindOptions.Height = 72;
            pnlFindOptions.BackColor = System.Drawing.Color.Transparent;
            pnlFindOptions.Tag = TSingleLineFlow.BeginGroupIndicator;
            pnlFindOptions.Controls.Add(btnFindNext);
            pnlFindOptions.Controls.Add(grpFindDirection);
            pnlFindOptions.SetDoubleBuffered(true);

            FPnlFindControls.Controls.Add(pnlFindOptions);

            //
            // FTabFilterAndFind
            //
            FTabFilterAndFind.BackColor = System.Drawing.Color.LightSteelBlue;
            FTabFilterAndFind.Alignment = System.Windows.Forms.TabAlignment.Bottom;
            FTabFilterAndFind.Controls.Add(FTbpFilter);
            FTabFilterAndFind.Controls.Add(FTbpFind);
            FTabFilterAndFind.Dock = System.Windows.Forms.DockStyle.Fill;
            FTabFilterAndFind.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
            FTabFilterAndFind.Font = new System.Drawing.Font("Verdana",
                7F,
                System.Drawing.FontStyle.Regular,
                System.Drawing.GraphicsUnit.Point,
                ((byte)(0)));
            FTabFilterAndFind.Location = new System.Drawing.Point(0, 0);
//.........这里部分代码省略.........
开发者ID:Davincier,项目名称:openpetra,代码行数:101,代码来源:ucoFilterAndFind.cs


注:本文中的System.Windows.Forms.Panel.SetDoubleBuffered方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。