コード例 #1
0
ファイル: TabCaption.cs プロジェクト: PIM4/integriert
 private Label CreateLabel()
 {
     label             = new TabLabel();
     label.Text        = String.Empty;
     label.TextAlign   = System.Drawing.ContentAlignment.MiddleLeft;
     label.Margin      = new System.Windows.Forms.Padding(2);
     label.MaximumSize = new System.Drawing.Size(125, 26);
     label.MouseUp    += delegate(object sender, MouseEventArgs e)
     {
         if (e.Button == MouseButtons.Middle)
         {
             if (ClosedTab != null)
             {
                 ClosedTab.Invoke(this, null);
             }
         }
         if (e.Button == MouseButtons.Left)
         {
             if (SelectedTab != null)
             {
                 SelectedTab.Invoke(this, null);
             }
         }
     };
     return(label);
 }
コード例 #2
0
        private DockPanel CreateComponent()
        {
            component = new TabCaptionComponent();

            component.ClosedTab += delegate
            {
                if (ClosedTab != null)
                {
                    ClosedTab.Invoke(this, null);
                }
            };

            return(component);
        }
コード例 #3
0
            private ImageButton CreateCloseButton()
            {
                closeButton             = new ImageButton();
                closeButton.Icon        = Demo.WPF.Resources.Close;
                closeButton.PressedIcon = Demo.WPF.Resources.ClosePressed;

                closeButton.ToolTip   = Demo.WPF.Resources.CloseTabButtonTooltip;
                closeButton.Width     = closeButton.Height = 25;
                closeButton.Focusable = false;
                closeButton.Click    += delegate
                {
                    if (ClosedTab != null)
                    {
                        ClosedTab.Invoke(this, null);
                    }
                };
                return(closeButton);
            }
コード例 #4
0
 private Label CreateLabel()
 {
     label = new Label();
     label.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
     label.VerticalAlignment   = System.Windows.VerticalAlignment.Center;
     label.Margin   = new Thickness(2);
     label.MaxWidth = 100;
     label.MouseUp += delegate(object sender, MouseButtonEventArgs e)
     {
         if (e.MiddleButton == MouseButtonState.Pressed)
         {
             if (ClosedTab != null)
             {
                 ClosedTab.Invoke(this, null);
             }
         }
     };
     return(label);
 }
コード例 #5
0
ファイル: TabCaption.cs プロジェクト: PIM4/integriert
            private ImageButton CreateCloseButton()
            {
                closeButton             = new ImageButton();
                closeButton.Icon        = Resources.Close;
                closeButton.PressedIcon = Resources.ClosePressed;
                closeButton.Dock        = DockStyle.Right;
                closeButton.Margin      = new System.Windows.Forms.Padding(3);

                closeButton.Text    = String.Empty;
                closeButton.ToolTip = WinForms.Demo.Properties.Resources.CloseTabButtonTooltip;
                closeButton.Click  += delegate
                {
                    if (ClosedTab != null)
                    {
                        ClosedTab.Invoke(this, null);
                    }
                };
                return(closeButton);
            }
コード例 #6
0
ファイル: TabCaption.cs プロジェクト: PIM4/integriert
        private FlowLayoutPanel CreateComponent()
        {
            component = new TabCaptionComponent();

            component.ClosedTab += delegate
            {
                if (ClosedTab != null)
                {
                    ClosedTab.Invoke(this, null);
                }
            };

            component.SelectedTab += delegate
            {
                SetSelected(true);
                if (SelectedTab != null)
                {
                    SelectedTab.Invoke(this, null);
                }
            };

            return(component);
        }