コード例 #1
0
        public override void InitializeNewComponent(IDictionary defaultValues)
        {
            base.InitializeNewComponent(defaultValues);
            BindingNavigator component = (BindingNavigator)base.Component;
            IDesignerHost    service   = (IDesignerHost)base.Component.Site.GetService(typeof(IDesignerHost));

            try
            {
                ToolStripDesigner._autoAddNewItems = false;
                component.SuspendLayout();
                component.AddStandardItems();
                this.SiteItems(service, component.Items);
                this.RaiseItemsChanged();
                component.ResumeLayout();
                component.ShowItemToolTips = true;
            }
            finally
            {
                ToolStripDesigner._autoAddNewItems = true;
            }
        }
コード例 #2
0
 private void InitializeComponent()
 {
     components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(離線列印Client程式.frmListPrintCodeForSelect));
     dgvPrint = new System.Windows.Forms.DataGridView();
     bn       = new System.Windows.Forms.BindingNavigator(components);
     bindingNavigatorCountItem        = new System.Windows.Forms.ToolStripLabel();
     bindingNavigatorMoveFirstItem    = new System.Windows.Forms.ToolStripButton();
     bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
     bindingNavigatorSeparator        = new System.Windows.Forms.ToolStripSeparator();
     bindingNavigatorPositionItem     = new System.Windows.Forms.ToolStripTextBox();
     bindingNavigatorSeparator1       = new System.Windows.Forms.ToolStripSeparator();
     bindingNavigatorMoveNextItem     = new System.Windows.Forms.ToolStripButton();
     bindingNavigatorMoveLastItem     = new System.Windows.Forms.ToolStripButton();
     bindingNavigatorSeparator2       = new System.Windows.Forms.ToolStripSeparator();
     bs         = new System.Windows.Forms.BindingSource(components);
     btnConfirm = new System.Windows.Forms.ToolStripButton();
     ((System.ComponentModel.ISupportInitialize)dgvPrint).BeginInit();
     ((System.ComponentModel.ISupportInitialize)bn).BeginInit();
     bn.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)bs).BeginInit();
     SuspendLayout();
     dgvPrint.AllowUserToAddRows          = false;
     dgvPrint.AllowUserToDeleteRows       = false;
     dgvPrint.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     dgvPrint.Location                = new System.Drawing.Point(12, 28);
     dgvPrint.Margin                  = new System.Windows.Forms.Padding(0);
     dgvPrint.Name                    = "dgvPrint";
     dgvPrint.ReadOnly                = true;
     dgvPrint.RowTemplate.Height      = 24;
     dgvPrint.Size                    = new System.Drawing.Size(988, 309);
     dgvPrint.TabIndex                = 0;
     dgvPrint.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvPrint_ColumnHeaderMouseClick);
     dgvPrint.CellClick              += new System.Windows.Forms.DataGridViewCellEventHandler(dgvPrint_CellClick);
     dgvPrint.CellContentClick       += new System.Windows.Forms.DataGridViewCellEventHandler(dgvPrint_CellContentClick);
     bn.AddNewItem                    = null;
     bn.CountItem  = bindingNavigatorCountItem;
     bn.DeleteItem = null;
     bn.Items.AddRange(new System.Windows.Forms.ToolStripItem[10]
     {
         bindingNavigatorMoveFirstItem,
         bindingNavigatorMovePreviousItem,
         bindingNavigatorSeparator,
         bindingNavigatorPositionItem,
         bindingNavigatorCountItem,
         bindingNavigatorSeparator1,
         bindingNavigatorMoveNextItem,
         bindingNavigatorMoveLastItem,
         bindingNavigatorSeparator2,
         btnConfirm
     });
     bn.Location                                = new System.Drawing.Point(0, 0);
     bn.MoveFirstItem                           = bindingNavigatorMoveFirstItem;
     bn.MoveLastItem                            = bindingNavigatorMoveLastItem;
     bn.MoveNextItem                            = bindingNavigatorMoveNextItem;
     bn.MovePreviousItem                        = bindingNavigatorMovePreviousItem;
     bn.Name                                    = "bn";
     bn.PositionItem                            = null;
     bn.Size                                    = new System.Drawing.Size(1009, 25);
     bn.TabIndex                                = 1;
     bn.Text                                    = "bindingNavigator1";
     bindingNavigatorCountItem.Name             = "bindingNavigatorCountItem";
     bindingNavigatorCountItem.Size             = new System.Drawing.Size(24, 22);
     bindingNavigatorCountItem.Text             = "/{0}";
     bindingNavigatorCountItem.ToolTipText      = "項目總數";
     bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     bindingNavigatorMoveFirstItem.Image        = (System.Drawing.Image)resources.GetObject("bindingNavigatorMoveFirstItem.Image");
     bindingNavigatorMoveFirstItem.Name         = "bindingNavigatorMoveFirstItem";
     bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
     bindingNavigatorMoveFirstItem.Size            = new System.Drawing.Size(23, 22);
     bindingNavigatorMoveFirstItem.Text            = "移到最前面";
     bindingNavigatorMoveFirstItem.Click          += new System.EventHandler(bindingNavigatorMoveFirstItem_Click);
     bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     bindingNavigatorMovePreviousItem.Image        = (System.Drawing.Image)resources.GetObject("bindingNavigatorMovePreviousItem.Image");
     bindingNavigatorMovePreviousItem.Name         = "bindingNavigatorMovePreviousItem";
     bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
     bindingNavigatorMovePreviousItem.Size                   = new System.Drawing.Size(23, 22);
     bindingNavigatorMovePreviousItem.Text                   = "移到上一個";
     bindingNavigatorMovePreviousItem.Click                 += new System.EventHandler(bindingNavigatorMovePreviousItem_Click);
     bindingNavigatorSeparator.Name                          = "bindingNavigatorSeparator";
     bindingNavigatorSeparator.Size                          = new System.Drawing.Size(6, 25);
     bindingNavigatorPositionItem.AccessibleName             = "位置";
     bindingNavigatorPositionItem.AutoSize                   = false;
     bindingNavigatorPositionItem.Name                       = "bindingNavigatorPositionItem";
     bindingNavigatorPositionItem.Size                       = new System.Drawing.Size(50, 22);
     bindingNavigatorPositionItem.Text                       = "0";
     bindingNavigatorPositionItem.ToolTipText                = "目前的位置";
     bindingNavigatorPositionItem.TextChanged               += new System.EventHandler(bindingNavigatorPositionItem_TextChanged);
     bindingNavigatorPositionItem.Click                     += new System.EventHandler(bindingNavigatorPositionItem_Click);
     bindingNavigatorSeparator1.Name                         = "bindingNavigatorSeparator1";
     bindingNavigatorSeparator1.Size                         = new System.Drawing.Size(6, 25);
     bindingNavigatorMoveNextItem.DisplayStyle               = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     bindingNavigatorMoveNextItem.Image                      = (System.Drawing.Image)resources.GetObject("bindingNavigatorMoveNextItem.Image");
     bindingNavigatorMoveNextItem.Name                       = "bindingNavigatorMoveNextItem";
     bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
     bindingNavigatorMoveNextItem.Size                       = new System.Drawing.Size(23, 22);
     bindingNavigatorMoveNextItem.Text                       = "移到下一個";
     bindingNavigatorMoveNextItem.Click                     += new System.EventHandler(bindingNavigatorMoveNextItem_Click);
     bindingNavigatorMoveLastItem.DisplayStyle               = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     bindingNavigatorMoveLastItem.Image                      = (System.Drawing.Image)resources.GetObject("bindingNavigatorMoveLastItem.Image");
     bindingNavigatorMoveLastItem.Name                       = "bindingNavigatorMoveLastItem";
     bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
     bindingNavigatorMoveLastItem.Size                       = new System.Drawing.Size(23, 22);
     bindingNavigatorMoveLastItem.Text                       = "移到最後面";
     bindingNavigatorMoveLastItem.Click                     += new System.EventHandler(bindingNavigatorMoveLastItem_Click);
     bindingNavigatorSeparator2.Name                         = "bindingNavigatorSeparator2";
     bindingNavigatorSeparator2.Size                         = new System.Drawing.Size(6, 25);
     btnConfirm.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     btnConfirm.Image                 = (System.Drawing.Image)resources.GetObject("btnConfirm.Image");
     btnConfirm.ImageTransparentColor = System.Drawing.Color.Magenta;
     btnConfirm.Name          = "btnConfirm";
     btnConfirm.Size          = new System.Drawing.Size(57, 22);
     btnConfirm.Text          = "確定選取";
     btnConfirm.Click        += new System.EventHandler(btnConfirm_Click);
     base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
     base.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     base.ClientSize          = new System.Drawing.Size(1009, 349);
     base.Controls.Add(bn);
     base.Controls.Add(dgvPrint);
     base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
     base.Icon            = (System.Drawing.Icon)resources.GetObject("$this.Icon");
     base.Name            = "frmListPrintCodeForSelect";
     base.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     Text                     = "請選擇您想下載的標籤";
     base.Load               += new System.EventHandler(frmListPrintCodeForSelect_Load);
     base.SizeChanged        += new System.EventHandler(frmListPrintCodeForSelect_SizeChanged);
     base.MaximumSizeChanged += new System.EventHandler(frmListPrintCodeForSelect_MaximumSizeChanged);
     ((System.ComponentModel.ISupportInitialize)dgvPrint).EndInit();
     ((System.ComponentModel.ISupportInitialize)bn).EndInit();
     bn.ResumeLayout(false);
     bn.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)bs).EndInit();
     ResumeLayout(false);
     PerformLayout();
 }