コード例 #1
0
ファイル: Form1.cs プロジェクト: Celtech/BolDevStudio
        private void krbTabControl1_ContextMenuShown(object sender, KRBTabControl.KRBTabControl.ContextMenuShownEventArgs e)
        {
            ToolStripMenuItem menuItem = new ToolStripMenuItem()
            {
                Text = "Another menu item",
                ShortcutKeys = Keys.Control | Keys.N
            };

            menuItem.Click += (thrower, ea) =>
            {
                MessageBox.Show("Hello World!!!");
            };

            e.ContextMenu.Items.Insert(0, new ToolStripSeparator());
            e.ContextMenu.Items.Insert(0, menuItem);

            menuItem = new ToolStripMenuItem()
            {
                Text = "Open a new tab",
                Image = this.ımageList1.Images[2],
                ShortcutKeys = Keys.Control | Keys.O
            };

            menuItem.Click += (thrower, ea) =>
            {
                KRBTabControl.TabPageEx newTabPage = new KRBTabControl.TabPageEx();
                newTabPage.ImageIndex = 2;
                krbTabControl1.TabPages.Add(newTabPage);
                Label newLabel = new Label();
                newLabel.AutoSize = true;
                newLabel.Text = String.Format("I've created by the drop-down menu, {0}", newTabPage.Text);
                newLabel.Font = new Font("Tahoma", 9.75f, FontStyle.Bold);
                newLabel.Location = new Point(10, 10);
                newTabPage.Controls.Add(newLabel);
            };

            e.ContextMenu.Items.Insert(0, new ToolStripSeparator());
            e.ContextMenu.Items.Insert(0, menuItem);
            e.ContextMenu.Items.Add(new ToolStripSeparator());

            menuItem = new ToolStripMenuItem("My Menu Item");
            if (krbTabControl1.SelectedTab != null)
            {
                menuItem.Click += (thrower, ea) =>
                {
                    MessageBox.Show(String.Format("Selected Tab Page: {0}", krbTabControl1.SelectedTab));
                };
            }
            e.ContextMenu.Items.Add(menuItem);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Celtech/BolDevStudio
 private void krbTabControl1_TabPageClosing(object sender, KRBTabControl.KRBTabControl.SelectedIndexChangingEventArgs e)
 {
     if (e.TabPage.Text == "Schedules")
     {
         if (MessageBox.Show("Do you want to remove the Schedules tab page?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
         {
             e.Cancel = true;
         }
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Celtech/BolDevStudio
 private void krbTabControl1_SelectedIndexChanging(object sender, KRBTabControl.KRBTabControl.SelectedIndexChangingEventArgs e)
 {
     if (e.TabPage.Text == "IsSelectable?")
         e.Cancel = true;
 }
コード例 #4
0
 public ColorizerDialog(KRBTabControl.KRBTabControl.RandomizerCaption colorizer)
     : this()
 {
     this.colorizer = colorizer;
 }