當前位置: 首頁>>代碼示例>>C#>>正文


C# ToolStripDropDownButton.HideImageMargin方法代碼示例

本文整理匯總了C#中System.Windows.Forms.ToolStripDropDownButton.HideImageMargin方法的典型用法代碼示例。如果您正苦於以下問題:C# ToolStripDropDownButton.HideImageMargin方法的具體用法?C# ToolStripDropDownButton.HideImageMargin怎麽用?C# ToolStripDropDownButton.HideImageMargin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.ToolStripDropDownButton的用法示例。


在下文中一共展示了ToolStripDropDownButton.HideImageMargin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateMenu


//.........這裏部分代碼省略.........
            tsbDeleteSelected = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_selected_object);
            tsbDeleteSelected.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbDeleteSelected.Image = Resources.layer__minus;
            tsbDeleteSelected.MouseDown += (sender, e) => DeleteCurrentShape();
            tsMain.Items.Add(tsbDeleteSelected);

            tsbDeleteAll = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_all_objects);
            tsbDeleteAll.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbDeleteAll.Image = Resources.eraser;
            tsbDeleteAll.MouseDown += (sender, e) => DeleteAllShapes();
            tsMain.Items.Add(tsbDeleteAll);

            #endregion Selected object

            #region Capture

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                ToolStripButton tsbFullscreenCapture = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
                tsbFullscreenCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbFullscreenCapture.Image = Resources.layer_fullscreen;
                tsbFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
                tsMain.Items.Add(tsbFullscreenCapture);

                ToolStripButton tsbActiveMonitorCapture = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
                tsbActiveMonitorCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbActiveMonitorCapture.Image = Resources.monitor;
                tsbActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
                tsMain.Items.Add(tsbActiveMonitorCapture);

                ToolStripDropDownButton tsddbMonitorCapture = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
                tsddbMonitorCapture.HideImageMargin();
                tsddbMonitorCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbMonitorCapture.Image = Resources.monitor_window;
                tsMain.Items.Add(tsddbMonitorCapture);

                tsddbMonitorCapture.DropDownItems.Clear();

                Screen[] screens = Screen.AllScreens;

                for (int i = 0; i < screens.Length; i++)
                {
                    Screen screen = screens[i];
                    ToolStripMenuItem tsmi = new ToolStripMenuItem(string.Format("{0}. {1}x{2}", i + 1, screen.Bounds.Width, screen.Bounds.Height));
                    int index = i;
                    tsmi.MouseDown += (sender, e) =>
                    {
                        form.MonitorIndex = index;
                        form.Close(RegionResult.Monitor);
                    };
                    tsddbMonitorCapture.DropDownItems.Add(tsmi);
                }
            }

            #endregion Capture

            #region Options

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
                tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
開發者ID:ElectronicWar,項目名稱:ShareX,代碼行數:67,代碼來源:ShapeManagerMenu.cs

示例2: CreateMenu


//.........這裏部分代碼省略.........
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbFillColor);

            tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
            tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbHighlightColor.Click += (sender, e) =>
            {
                PauseForm();

                using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        AnnotationOptions.HighlightColor = dialogColor.NewColor;
                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbHighlightColor);

            tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
            tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbShapeOptions.HideImageMargin();
            tsddbShapeOptions.Image = Resources.layer__pencil;
            tsMain.Items.Add(tsddbShapeOptions);

            tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
            tslnudBorderSize.Content.Minimum = 0;
            tslnudBorderSize.Content.Maximum = 20;
            tslnudBorderSize.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                int borderSize = (int)tslnudBorderSize.Content.Value;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    AnnotationOptions.TextBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    AnnotationOptions.StepBorderSize = borderSize;
                }
                else
                {
                    AnnotationOptions.BorderSize = borderSize;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);

            tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
            tslnudCornerRadius.Content.Minimum = 0;
            tslnudCornerRadius.Content.Maximum = 150;
開發者ID:thanhpd,項目名稱:ShareX,代碼行數:67,代碼來源:ShapeManagerMenu.cs


注:本文中的System.Windows.Forms.ToolStripDropDownButton.HideImageMargin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。