本文整理汇总了C#中System.Windows.Forms.ToolStrip.ResumeLayout方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStrip.ResumeLayout方法的具体用法?C# ToolStrip.ResumeLayout怎么用?C# ToolStrip.ResumeLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStrip
的用法示例。
在下文中一共展示了ToolStrip.ResumeLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateToolbar
public static void UpdateToolbar(ToolStrip toolStrip)
{
toolStrip.SuspendLayout();
foreach (ToolStripItem item in toolStrip.Items) {
if (item is IStatusUpdate) {
((IStatusUpdate)item).UpdateStatus();
}
}
toolStrip.ResumeLayout();
//toolStrip.Refresh();
}
示例2: ToolStrip1
public ToolStrip1()
{
ToolStrip toolStrip = new ToolStrip();
toolStrip.SuspendLayout();
toolStrip.Dock = DockStyle.Top;
var tb = zForm.CreateToolStripTextBox(backColor: SystemColors.Control, width: 100);
tb.Enabled = false;
toolStrip.Items.Add(tb);
toolStrip.Items.Add(zForm.CreateToolStripLabel("tata"));
toolStrip.Items.Add(zForm.CreateToolStripLabelSeparator(100));
toolStrip.Items.Add(zForm.CreateToolStripTextBox("toto"));
toolStrip.ResumeLayout(false);
this.SuspendLayout();
this.ClientSize = new Size(1000, 300);
this.Controls.Add(toolStrip);
this.ResumeLayout(false);
this.PerformLayout();
}
示例3: addImportXLSFileItem
/// <summary>
/// Gắn nút cho phép import dữ liệu từ excel file và gắn vào toolStripBar.( giống như các màn hình danh mục)
/// </summary>
public static ToolStripDropDownButton addImportXLSFileItem(ToolStrip toolStripBar, GridView gridView)
{
if (gridView is PLGridView)
{
toolStripBar.SuspendLayout();
ToolStripDropDownButton importXLSFile = new System.Windows.Forms.ToolStripDropDownButton();
importXLSFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
//TODO:
importXLSFile.Image = FWImageDic.EXPORT_TO_FILE_IMAGE20;
importXLSFile.ImageTransparentColor = System.Drawing.Color.Magenta;
importXLSFile.Name = "ImportXLSFile";
importXLSFile.Size = new System.Drawing.Size(200, 20);
importXLSFile.Text = "Nhập từ file";
ToolStripMenuItem xlsFileMau = new ToolStripMenuItem("Xuất File mẫu để vào dữ liệu");
xlsFileMau.Name = "xlsFileMau";
xlsFileMau.DisplayStyle = ToolStripItemDisplayStyle.Text;
xlsFileMau.Size = new System.Drawing.Size(200, 20);
xlsFileMau.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "xlsx");
};
importXLSFile.DropDownItems.Add(xlsFileMau);
ToolStripMenuItem itemChonFileImport = new ToolStripMenuItem("Chọn File chứa dữ liệu nhập");
itemChonFileImport.Name = "itemChonFileImport";
itemChonFileImport.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemChonFileImport.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "xls");
};
importXLSFile.DropDownItems.Add(itemChonFileImport);
toolStripBar.Items.Add(importXLSFile);
toolStripBar.ResumeLayout(false);
toolStripBar.PerformLayout();
return importXLSFile;
}
return null;
}
示例4: addInLuoiItem
/// <summary>
/// Gắn item IN lưới vào toolStripBar.
/// </summary>
public static ToolStripDropDownButton addInLuoiItem(ToolStrip toolStripBar, GridView gridView)
{
toolStripBar.SuspendLayout();
ToolStripSeparator InLuoiSep = new System.Windows.Forms.ToolStripSeparator();
InLuoiSep.Name = "InLuoiSep";
InLuoiSep.Size = new System.Drawing.Size(200, 20);
ToolStripDropDownButton inLuoi = new System.Windows.Forms.ToolStripDropDownButton();
inLuoi.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
inLuoi.Image = FWImageDic.PRINT_IMAGE20;
inLuoi.ImageTransparentColor = System.Drawing.Color.Magenta;
inLuoi.Name = "inLuoi";
inLuoi.Size = new System.Drawing.Size(200, 20);
inLuoi.Text = "In danh sách";
ToolStripMenuItem itemIn = new ToolStripMenuItem("In");
itemIn.Name = "in";
itemIn.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemIn.Size = new System.Drawing.Size(200, 20);
itemIn.Click += delegate(object sender, EventArgs e)
{
if (gridView.GridControl != null)
{
gridView.GridControl.Print();
}
};
inLuoi.DropDownItems.Add(itemIn);
ToolStripMenuItem itemXemTruoc = new ToolStripMenuItem("Xem trước");
itemXemTruoc.Name = "xemTruoc";
itemXemTruoc.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemXemTruoc.Size = new System.Drawing.Size(200, 20);
itemXemTruoc.Click += delegate(object sender, EventArgs e)
{
HelpMsgBox._showWaitingMsg(delegate(){
if (gridView.GridControl != null)
{
gridView.GridControl.ShowPrintPreview();
}
});
};
inLuoi.DropDownItems.Add(itemXemTruoc);
toolStripBar.Items.Add(InLuoiSep);
toolStripBar.Items.Add(inLuoi);
toolStripBar.ResumeLayout(false);
toolStripBar.PerformLayout();
return inLuoi;
}
示例5: InitializeComponent
//.........这里部分代码省略.........
//
// _renameListContextMenuItem
//
_renameListContextMenuItem.Image = global::Rsdn.LocUtil.Properties.Resources.Rename;
_renameListContextMenuItem.Name = "_renameListContextMenuItem";
_renameListContextMenuItem.Size = new System.Drawing.Size(124, 22);
_renameListContextMenuItem.Text = "Re&name";
_renameListContextMenuItem.Click += new System.EventHandler(this._renameResourceMenuItem_Click);
//
// _treeContextMenu
//
this._treeContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
_addTreeContextMenuIten});
this._treeContextMenu.Name = "_treeContextMenu";
this._treeContextMenu.Size = new System.Drawing.Size(105, 26);
this._treeContextMenu.Click += new System.EventHandler(this._addResourceMenuItem_Click);
//
// _listContextMenu
//
this._listContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
_removeListContextMenuItem,
removeToolStripMenuItem,
_renameListContextMenuItem});
this._listContextMenu.Name = "_listContextMenu";
this._listContextMenu.Size = new System.Drawing.Size(125, 70);
//
// _openFileDialog
//
this._openFileDialog.DefaultExt = "resx";
this._openFileDialog.Filter = "ResX files|*.resx";
//
// BottomToolStripPanel
//
this.BottomToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.BottomToolStripPanel.Name = "BottomToolStripPanel";
this.BottomToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.BottomToolStripPanel.RowMargin = new System.Windows.Forms.Padding(0);
this.BottomToolStripPanel.Size = new System.Drawing.Size(0, 0);
//
// TopToolStripPanel
//
this.TopToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.TopToolStripPanel.Name = "TopToolStripPanel";
this.TopToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.TopToolStripPanel.RowMargin = new System.Windows.Forms.Padding(0);
this.TopToolStripPanel.Size = new System.Drawing.Size(0, 0);
//
// RightToolStripPanel
//
this.RightToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.RightToolStripPanel.Name = "RightToolStripPanel";
this.RightToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.RightToolStripPanel.RowMargin = new System.Windows.Forms.Padding(0);
this.RightToolStripPanel.Size = new System.Drawing.Size(0, 0);
//
// LeftToolStripPanel
//
this.LeftToolStripPanel.Location = new System.Drawing.Point(0, 0);
this.LeftToolStripPanel.Name = "LeftToolStripPanel";
this.LeftToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.LeftToolStripPanel.RowMargin = new System.Windows.Forms.Padding(0);
this.LeftToolStripPanel.Size = new System.Drawing.Size(0, 0);
//
// ContentPanel
//
this.ContentPanel.Size = new System.Drawing.Size(200, 100);
//
// MainForm
//
this.ClientSize = new System.Drawing.Size(792, 566);
this.Controls.Add(_toolStripContainer);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this._menuStrip;
this.Name = "MainForm";
this.Text = "Localization utility";
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
toolStrip2.ResumeLayout(false);
toolStrip2.PerformLayout();
_toolStripContainer.ContentPanel.ResumeLayout(false);
_toolStripContainer.TopToolStripPanel.ResumeLayout(false);
_toolStripContainer.TopToolStripPanel.PerformLayout();
_toolStripContainer.ResumeLayout(false);
_toolStripContainer.PerformLayout();
this._treeSplitter.Panel1.ResumeLayout(false);
this._treeSplitter.Panel2.ResumeLayout(false);
this._treeSplitter.ResumeLayout(false);
this._paneTree.ResumeLayout(false);
this._resourceSplitter.Panel1.ResumeLayout(false);
this._resourceSplitter.Panel2.ResumeLayout(false);
this._resourceSplitter.ResumeLayout(false);
this._paneItems.ResumeLayout(false);
this._paneProperties.ResumeLayout(false);
this._menuStrip.ResumeLayout(false);
this._menuStrip.PerformLayout();
this._treeContextMenu.ResumeLayout(false);
this._listContextMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
示例6: BuildToolStrip
/// <summary>
/// Called to build menus and toolbars. Override this method to customize menu and toolbar building.
/// </summary>
/// <remarks>
/// The default implementation simply clears and re-creates the toolstrip using methods on the
/// utility class <see cref="ToolStripBuilder"/>.
/// </remarks>
/// <param name="kind"></param>
/// <param name="toolStrip"></param>
/// <param name="actionModel"></param>
protected virtual void BuildToolStrip(ToolStripBuilder.ToolStripKind kind, ToolStrip toolStrip, ActionModelNode actionModel)
{
// avoid flicker
toolStrip.SuspendLayout();
// very important to clean up the existing ones first
ToolStripBuilder.Clear(toolStrip.Items);
if (actionModel != null)
{
if (actionModel.ChildNodes.Count > 0)
{
// Toolstrip should only be visible if there are items on it
if (kind == ToolStripBuilder.ToolStripKind.Toolbar)
ToolStripBuilder.BuildToolStrip(kind, toolStrip.Items, actionModel.ChildNodes, ToolStripBuilder.ToolStripBuilderStyle.GetDefault(), ToolStripSettings.Default.IconSize);
else
ToolStripBuilder.BuildToolStrip(kind, toolStrip.Items, actionModel.ChildNodes);
}
}
toolStrip.ResumeLayout();
}
示例7: PropertyGrid
public PropertyGrid() {
onComponentAdd = new ComponentEventHandler(OnComponentAdd);
onComponentRemove = new ComponentEventHandler(OnComponentRemove);
onComponentChanged = new ComponentChangedEventHandler(OnComponentChanged);
SuspendLayout();
AutoScaleMode = AutoScaleMode.None;
if (!isScalingInitialized) {
if (DpiHelper.IsScalingRequired) {
normalButtonSize = DpiHelper.LogicalToDeviceUnits(DEFAULT_NORMAL_BUTTON_SIZE);
largeButtonSize = DpiHelper.LogicalToDeviceUnits(DEFAULT_LARGE_BUTTON_SIZE);
}
isScalingInitialized = true;
}
try
{
gridView = CreateGridView(null);
gridView.TabStop = true;
gridView.MouseMove += new MouseEventHandler(this.OnChildMouseMove);
gridView.MouseDown += new MouseEventHandler(this.OnChildMouseDown);
gridView.TabIndex = 2;
separator1 = CreateSeparatorButton();
separator2 = CreateSeparatorButton();
toolStrip = new ToolStrip();
toolStrip.SuspendLayout();
toolStrip.ShowItemToolTips = true;
toolStrip.AccessibleName = SR.GetString(SR.PropertyGridToolbarAccessibleName);
toolStrip.AccessibleRole = AccessibleRole.ToolBar;
toolStrip.TabStop = true;
toolStrip.AllowMerge = false;
// This caption is for testing.
toolStrip.Text = "PropertyGridToolBar";
// LayoutInternal handles positioning, and for perf reasons, we manually size.
toolStrip.Dock = DockStyle.None;
toolStrip.AutoSize = false;
toolStrip.TabIndex = 1;
toolStrip.ImageScalingSize = normalButtonSize;
// parity with the old...
toolStrip.CanOverflow = false;
// hide the grip but add in a few more pixels of padding.
toolStrip.GripStyle = ToolStripGripStyle.Hidden;
Padding toolStripPadding = toolStrip.Padding;
toolStripPadding.Left = 2;
toolStrip.Padding = toolStripPadding;
SetToolStripRenderer();
// always add the property tab here
AddRefTab(DefaultTabType, null, PropertyTabScope.Static, true);
doccomment = new DocComment(this);
doccomment.SuspendLayout();
doccomment.TabStop = false;
doccomment.Dock = DockStyle.None;
doccomment.BackColor = SystemColors.Control;
doccomment.ForeColor = SystemColors.ControlText;
doccomment.MouseMove += new MouseEventHandler(this.OnChildMouseMove);
doccomment.MouseDown += new MouseEventHandler(this.OnChildMouseDown);
hotcommands = new HotCommands(this);
hotcommands.SuspendLayout();
hotcommands.TabIndex = 3;
hotcommands.Dock = DockStyle.None;
SetHotCommandColors(false);
hotcommands.Visible = false;
hotcommands.MouseMove += new MouseEventHandler(this.OnChildMouseMove);
hotcommands.MouseDown += new MouseEventHandler(this.OnChildMouseDown);
Controls.AddRange(new Control[] { doccomment, hotcommands, gridView, toolStrip });
SetActiveControlInternal(gridView);
toolStrip.ResumeLayout(false); // SetupToolbar should perform the layout
SetupToolbar();
this.PropertySort = PropertySort.Categorized | PropertySort.Alphabetical;
this.Text = "PropertyGrid";
SetSelectState(0);
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
finally {
if (doccomment != null) {
doccomment.ResumeLayout(false);
}
if (hotcommands != null) {
hotcommands.ResumeLayout(false);
}
//.........这里部分代码省略.........
示例8: RevertMerge
public static bool RevertMerge (ToolStrip targetToolStrip, ToolStrip sourceToolStrip)
{
if (sourceToolStrip == null)
throw new ArgumentNullException ("sourceToolStrip");
List<ToolStripItem> items_to_move = new List<ToolStripItem> ();
// Find every ToolStripItem who's Owner is the source toolstrip
// - If it's a TSMI, see if any of the subitems need to be moved back
foreach (ToolStripItem tsi in targetToolStrip.Items) {
if (tsi.Owner == sourceToolStrip)
items_to_move.Add (tsi);
else if (tsi is ToolStripMenuItem)
foreach (ToolStripItem menuitem in (tsi as ToolStripMenuItem).DropDownItems)
foreach (ToolStripMenuItem tsmi in sourceToolStrip.Items)
if (menuitem.Owner == tsmi.DropDown)
items_to_move.Add (menuitem);
}
// If we didn't find anything, return false
if (items_to_move.Count == 0 && targetToolStrip.HiddenMergedItems.Count == 0)
return false;
// Put back all the target's items removed in the merge
while (targetToolStrip.HiddenMergedItems.Count > 0) {
targetToolStrip.RevertMergeItem (targetToolStrip.HiddenMergedItems[0]);
targetToolStrip.HiddenMergedItems.RemoveAt (0);
}
sourceToolStrip.SuspendLayout ();
targetToolStrip.SuspendLayout ();
// Revert everything
while (items_to_move.Count > 0) {
sourceToolStrip.RevertMergeItem (items_to_move[0]);
items_to_move.Remove (items_to_move[0]);
}
sourceToolStrip.ResumeLayout ();
targetToolStrip.ResumeLayout ();
sourceToolStrip.IsCurrentlyMerged = false;
targetToolStrip.IsCurrentlyMerged = false;
sourceToolStrip.CurrentlyMergedWith = null;
targetToolStrip.CurrentlyMergedWith = null;
return true;
}
示例9: PopulateToolStripFromRoot
private IDisposableContainer PopulateToolStripFromRoot(ToolStrip toolStrip, IVirtualFolder currentRoot, bool hideNotReadyDrives)
{
IDisposableContainer container2;
toolStrip.SuspendLayout();
try
{
ToolStripSeparator separator;
toolStrip.Items.Clear();
VirtualProperty property = VirtualProperty.Get(VirtualFilePanelSettings.Default.DriveMenuProperty);
if ((property != null) && (property.GroupName != "Volume"))
{
property = null;
}
IDisposableContainer container = new DisposableContainer();
System.Type type = null;
int num = 0;
Image image = Settings.Default.IsShowIcons ? ImageProvider.Default.GetDefaultIcon(DefaultIcon.Drive, ImageHelper.DefaultSmallIconSize) : null;
foreach (IVirtualFolder folder in VirtualItem.GetRootFolders())
{
if (!(!hideNotReadyDrives || IsRootFolderVisible(folder)))
{
num++;
continue;
}
if ((type != null) && (folder.GetType() != type))
{
separator = new ToolStripSeparator();
container.Add(separator);
toolStrip.Items.Add(separator);
}
type = folder.GetType();
string str = folder.Name.Replace("&", "&&");
int index = str.IndexOf(':');
if (index >= 0)
{
str = str.Insert(index - 1, "&");
}
ToolStripMenuItem toolStripItem = new ToolStripMenuItem();
this.InitializeVirtualRootToolStrip(toolStripItem, folder);
if (folder.Equals(currentRoot))
{
toolStripItem.Font = new Font(toolStripItem.Font, FontStyle.Bold);
container.Add(toolStripItem.Font);
}
if (property != null)
{
try
{
object obj2 = folder[property.PropertyId];
if (obj2 != null)
{
toolStripItem.ShortcutKeyDisplayString = property.ConvertToString(obj2);
toolStripItem.ShowShortcutKeys = true;
}
}
catch (SystemException exception)
{
if (!(exception is IOException) && !(exception is UnauthorizedAccessException))
{
throw;
}
toolStripItem.ShortcutKeyDisplayString = Resources.sDeviceNotReady;
toolStripItem.ShowShortcutKeys = true;
}
}
container.Add(toolStripItem);
toolStrip.Items.Add(toolStripItem);
VirtualItemToolStripEvents.UpdateItemImage(toolStripItem, folder);
}
if (num > 0)
{
separator = new ToolStripSeparator();
container.Add(separator);
toolStrip.Items.Add(separator);
ToolStripItem item = new ToolStripMenuItem(string.Format(Resources.sShowHiddenDrives, num)) {
Tag = toolStrip
};
item.Click += new EventHandler(this.tsmiShowHidden_Click);
container.Add(item);
toolStrip.Items.Add(item);
}
container2 = container;
}
finally
{
toolStrip.ResumeLayout();
}
return container2;
}
示例10: Merge
public static bool Merge(ToolStrip sourceToolStrip, ToolStrip targetToolStrip)
{
if (sourceToolStrip == null)
{
throw new ArgumentNullException("sourceToolStrip");
}
if (targetToolStrip == null)
{
throw new ArgumentNullException("targetToolStrip");
}
if (targetToolStrip == sourceToolStrip)
{
throw new ArgumentException(System.Windows.Forms.SR.GetString("ToolStripMergeImpossibleIdentical"));
}
bool flag = IsSpecialMDIStrip(sourceToolStrip) || ((sourceToolStrip.AllowMerge && targetToolStrip.AllowMerge) && (sourceToolStrip.GetType().IsAssignableFrom(targetToolStrip.GetType()) || targetToolStrip.GetType().IsAssignableFrom(sourceToolStrip.GetType())));
MergeHistory history = null;
if (flag)
{
history = new MergeHistory(sourceToolStrip);
int count = sourceToolStrip.Items.Count;
if (count > 0)
{
sourceToolStrip.SuspendLayout();
targetToolStrip.SuspendLayout();
try
{
int num2 = count;
int num3 = 0;
int num4 = 0;
while (num3 < count)
{
ToolStripItem source = sourceToolStrip.Items[num4];
MergeRecursive(source, targetToolStrip.Items, history.MergeHistoryItemsStack);
int num5 = num2 - sourceToolStrip.Items.Count;
num4 = (num5 > 0) ? num4 : (num4 + 1);
num2 = sourceToolStrip.Items.Count;
num3++;
}
}
finally
{
sourceToolStrip.ResumeLayout();
targetToolStrip.ResumeLayout();
}
if (history.MergeHistoryItemsStack.Count > 0)
{
targetToolStrip.MergeHistoryStack.Push(history);
}
}
}
bool flag2 = false;
if ((history != null) && (history.MergeHistoryItemsStack.Count > 0))
{
flag2 = true;
}
return flag2;
}
示例11: InitializeComponent
private void InitializeComponent()
{
#region Creating and styling form controls
this.SuspendLayout();
toolStrip = new ToolStrip();
toolStrip.Dock = DockStyle.None;
toolStrip.Cursor = Cursors.Default;
toolStrip.ImageScalingSize = new Size(32, 32);
toolStrip.BackColor = Color.Transparent;
toolStrip.GripStyle = ToolStripGripStyle.Hidden;
toolStrip.Renderer = new CustomToolStripRenderer();
toolStrip.AutoSize = true;
//toolStrip.Width = 500;
toolStrip.SuspendLayout();
toolStrip.Visible = false;
// buttons
buttonSave = new ToolStripButton();
buttonSave.Image = global::QwikShot.WinApp.Properties.Resources.image_save;
buttonSave.DisplayStyle = ToolStripItemDisplayStyle.Image;
buttonSave.ImageAlign = ContentAlignment.MiddleCenter;
buttonSave.ToolTipText = "Save Image and Copy to Clipboard";
buttonSave.Margin = new Padding(0, 0, 4, 0);
buttonSave.Click += buttonSave_Click;
buttonCopy = new ToolStripButton();
buttonCopy.Image = global::QwikShot.WinApp.Properties.Resources.image_copy;
buttonCopy.DisplayStyle = ToolStripItemDisplayStyle.Image;
buttonCopy.ImageAlign = ContentAlignment.MiddleCenter;
buttonCopy.ToolTipText = "Copy Image to Clipboard";
buttonCopy.Margin = new Padding(0, 0, 4, 0);
buttonCopy.Click += buttonCopy_Click;
buttonNetwork = new ToolStripButton();
buttonNetwork.Image = global::QwikShot.WinApp.Properties.Resources.image_network;
buttonNetwork.DisplayStyle = ToolStripItemDisplayStyle.Image;
buttonNetwork.ImageAlign = ContentAlignment.MiddleCenter;
buttonNetwork.ToolTipText = "Share Over Network";
buttonNetwork.Margin = new Padding(0, 0, 4, 0);
buttonNetwork.Click += buttonNetwork_Click;
buttonInternet = new ToolStripButton();
buttonInternet.Image = global::QwikShot.WinApp.Properties.Resources.image_internet;
buttonInternet.DisplayStyle = ToolStripItemDisplayStyle.Image;
buttonInternet.ImageAlign = ContentAlignment.MiddleCenter;
buttonInternet.ToolTipText = "Share Through Internet";
buttonInternet.Margin = new Padding(0, 0, 4, 0);
buttonInternet.Click += buttonInternet_Click;
buttonClose = new ToolStripButton();
buttonClose.Image = global::QwikShot.WinApp.Properties.Resources.image_close;
buttonClose.DisplayStyle = ToolStripItemDisplayStyle.Image;
buttonClose.ImageAlign = ContentAlignment.MiddleCenter;
buttonClose.ToolTipText = "Cancel";
buttonClose.Margin = new Padding(0, 0, 4, 0);
buttonClose.Click += buttonClose_Click;
// separators
ToolStripSeparator separator1 = new ToolStripSeparator();
separator1.AutoSize = false;
separator1.Size = new Size(24, 0);
ToolStripSeparator separator2 = new ToolStripSeparator();
separator2.AutoSize = false;
separator2.Size = new Size(48, 0);
toolStrip.ResumeLayout(false);
toolStrip.Items.AddRange(new ToolStripItem[] { buttonSave, buttonCopy, separator1, buttonNetwork, buttonInternet, separator2, buttonClose });
this.Controls.Add(toolStrip);
instructions = new Label();
instructions.Text = "Press Enter to upload region to imgur.";
instructions.Font = new Font(instructions.Font.FontFamily, 12, FontStyle.Regular);
instructions.ForeColor = Color.FromArgb(64, 64, 64);
instructions.BackColor = Color.Transparent;
instructions.AutoSize = true;
this.Controls.Add(instructions);
this.ResumeLayout(false);
#endregion
regionBorderPen = new Pen(Color.FromArgb(100, 149, 237), 1);
regionBorderPen.DashStyle = DashStyle.Solid;
MouseMove += ScreenShotRegionOverlay_MouseMove;
MouseDown += ScreenShotRegionOverlay_MouseDown;
MouseUp += ScreenShotRegionOverlay_MouseUp;
}
示例12: InitializeComponent
//.........这里部分代码省略.........
mnuMainMenuStrip.Items.AddRange(new ToolStripItem[] { startSimulationToolStripMenuItem, toolsToolStripMenuItem, windowToolStripMenuItem, helpToolStripMenuItem });
mnuMainMenuStrip.Location = new Point(0, 0);
mnuMainMenuStrip.Name = "mnuMainMenuStrip";
mnuMainMenuStrip.Size = new Size(0x259, 0x18);
mnuMainMenuStrip.TabIndex = 7;
mnuMainMenuStrip.Text = "menuStrip1";
startSimulationToolStripMenuItem.Name = "startSimulationToolStripMenuItem";
startSimulationToolStripMenuItem.Size = new Size(0x66, 20);
startSimulationToolStripMenuItem.Text = "Start simulation";
startSimulationToolStripMenuItem.Click += new EventHandler(startSimulationToolStripMenuItem_Click);
toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { sendFeedbackToolStripMenuItem, licenseManagerToolStripMenuItem, preferencesToolStripMenuItem });
toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
toolsToolStripMenuItem.Size = new Size(0x30, 20);
toolsToolStripMenuItem.Text = "Tools";
sendFeedbackToolStripMenuItem.Name = "sendFeedbackToolStripMenuItem";
sendFeedbackToolStripMenuItem.Size = new Size(0xa3, 0x16);
sendFeedbackToolStripMenuItem.Text = "Send feedback";
sendFeedbackToolStripMenuItem.Click += new EventHandler(sendFeedbackToolStripMenuItem_Click);
licenseManagerToolStripMenuItem.Name = "licenseManagerToolStripMenuItem";
licenseManagerToolStripMenuItem.Size = new Size(0xa3, 0x16);
licenseManagerToolStripMenuItem.Text = "License manager";
licenseManagerToolStripMenuItem.Click += new EventHandler(licenseManagerToolStripMenuItem_Click);
preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
preferencesToolStripMenuItem.Size = new Size(0xa3, 0x16);
preferencesToolStripMenuItem.Text = "Preferences";
preferencesToolStripMenuItem.Click += new EventHandler(preferencesToolStripMenuItem_Click);
windowToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { cascadeWindowsToolStripMenuItem, tileHorizontalToolStripMenuItem, tileVerticalToolStripMenuItem, toolStripMenuItem1, showLogWindowToolStripMenuItem });
windowToolStripMenuItem.Name = "windowToolStripMenuItem";
windowToolStripMenuItem.Size = new Size(0x3f, 20);
windowToolStripMenuItem.Text = "Window";
cascadeWindowsToolStripMenuItem.Name = "cascadeWindowsToolStripMenuItem";
cascadeWindowsToolStripMenuItem.Size = new Size(0xa8, 0x16);
cascadeWindowsToolStripMenuItem.Text = "Cascade";
cascadeWindowsToolStripMenuItem.Click += new EventHandler(cascadeWindowsToolStripMenuItem_Click);
tileHorizontalToolStripMenuItem.Name = "tileHorizontalToolStripMenuItem";
tileHorizontalToolStripMenuItem.Size = new Size(0xa8, 0x16);
tileHorizontalToolStripMenuItem.Text = "Tile horizontal";
tileHorizontalToolStripMenuItem.Click += new EventHandler(tileHorizontalToolStripMenuItem_Click);
tileVerticalToolStripMenuItem.Name = "tileVerticalToolStripMenuItem";
tileVerticalToolStripMenuItem.Size = new Size(0xa8, 0x16);
tileVerticalToolStripMenuItem.Text = "Tile vertical";
tileVerticalToolStripMenuItem.Click += new EventHandler(tileVerticalToolStripMenuItem_Click);
toolStripMenuItem1.Name = "toolStripMenuItem1";
toolStripMenuItem1.Size = new Size(0xa5, 6);
showLogWindowToolStripMenuItem.Name = "showLogWindowToolStripMenuItem";
showLogWindowToolStripMenuItem.Size = new Size(0xa8, 0x16);
showLogWindowToolStripMenuItem.Text = "Show log window";
showLogWindowToolStripMenuItem.Click += new EventHandler(showLogWindowToolStripMenuItem_Click);
helpToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { aboutWDSToolStripMenuItem, supportedDevicesToolStripMenuItem, productInformationToolStripMenuItem });
helpToolStripMenuItem.Name = "helpToolStripMenuItem";
helpToolStripMenuItem.Size = new Size(0x2c, 20);
helpToolStripMenuItem.Text = "Help";
aboutWDSToolStripMenuItem.Name = "aboutWDSToolStripMenuItem";
aboutWDSToolStripMenuItem.Size = new Size(0xb6, 0x16);
aboutWDSToolStripMenuItem.Text = "About WDS";
aboutWDSToolStripMenuItem.Click += new EventHandler(aboutWDSToolStripMenuItem_Click);
supportedDevicesToolStripMenuItem.Name = "supportedDevicesToolStripMenuItem";
supportedDevicesToolStripMenuItem.Size = new Size(0xb6, 0x16);
supportedDevicesToolStripMenuItem.Text = "Supported devices";
supportedDevicesToolStripMenuItem.Click += new EventHandler(supportedDevicesToolStripMenuItem_Click);
productInformationToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ezRadioProToolStripMenuItem, eZRadioToolStripMenuItem });
productInformationToolStripMenuItem.Name = "productInformationToolStripMenuItem";
productInformationToolStripMenuItem.Size = new Size(0xb6, 0x16);
productInformationToolStripMenuItem.Text = "Product information";
ezRadioProToolStripMenuItem.Name = "ezRadioProToolStripMenuItem";
ezRadioProToolStripMenuItem.Size = new Size(0x85, 0x16);
ezRadioProToolStripMenuItem.Text = "EzRadioPro";
ezRadioProToolStripMenuItem.Click += new EventHandler(ezRadioProToolStripMenuItem_Click);
eZRadioToolStripMenuItem.Name = "eZRadioToolStripMenuItem";
eZRadioToolStripMenuItem.Size = new Size(0x85, 0x16);
eZRadioToolStripMenuItem.Text = "EZRadio";
eZRadioToolStripMenuItem.Click += new EventHandler(eZRadioToolStripMenuItem_Click);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
BackgroundImage = (Image) resources.GetObject("$BackgroundImage");
BackgroundImageLayout = ImageLayout.Zoom;
base.ClientSize = new Size(0x259, 0x1cd);
base.Controls.Add(toolStrip1);
base.Controls.Add(mnuMainMenuStrip);
DoubleBuffered = true;
Font = new Font("Microsoft Sans Serif", 8.25f);
base.Icon = (Icon) resources.GetObject("$Icon");
base.IsMdiContainer = true;
base.MainMenuStrip = mnuMainMenuStrip;
base.Name = "WDSFrameWindow";
base.StartPosition = FormStartPosition.Manual;
Text = "Wireless Development Suite";
base.WindowState = FormWindowState.Maximized;
base.Load += new EventHandler(WDSFrameWindow_Load);
base.ClientSizeChanged += new EventHandler(clientSizeChanged);
base.Shown += new EventHandler(WDSFrameWindow_Shown);
base.FormClosed += new FormClosedEventHandler(WDSFrameWindow_FormClosed);
base.FormClosing += new FormClosingEventHandler(WDSFrameWindow_FormClosing);
base.Resize += new EventHandler(WDSFrameWindow_Resize);
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
mnuMainMenuStrip.ResumeLayout(false);
mnuMainMenuStrip.PerformLayout();
base.ResumeLayout(false);
base.PerformLayout();
}
示例13: LoadBtnToolStrip
public void LoadBtnToolStrip(ToolStrip ts, String fileName)
{
ts.SuspendLayout();
if (fileName != null)
{
try
{
String tempStr;
tempStr = fileName.Split(new char[] { '.' })[fileName.Split(new char[] { '.' }).Length - 1];
if (tempStr.ToUpper() == "XML" && File.Exists(fileName))
{
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
XmlNode root = doc.SelectSingleNode("/root/buttons");
for (int i = 0; i < root.ChildNodes.Count; i++)
{
XmlElement elem = (XmlElement)root.ChildNodes[i];
ToolStripButton btn = new ToolStripButton();
btn.Text = elem.Attributes["Text"].InnerText;
btn.Name = elem.Attributes["Name"].InnerText;
try
{
btn.Image = Image.FromFile(elem.Attributes["Image"].InnerText);
}
catch
{
Trace.WriteLine("Error:加载工具栏按钮错误\""+btn.Name+"\" Image 加载错误");
}
btn.Tag = elem.Attributes["Function"].InnerText;
try
{
string visibleStr = elem.Attributes["visible"].InnerText;
btn.Visible = bool.Parse(visibleStr);
}
catch
{
Trace.WriteLine("Error:加载工具栏按钮错误,按钮\""+btn.Name+"\" visble 解析错误");
}
try
{
string imgFileName = elem.Attributes["Image"].InnerText;
if (imgFileName != "" && File.Exists(imgFileName))
{
btn.Image = Image.FromFile(imgFileName);
}
}
catch
{
}
btn.TextImageRelation = TextImageRelation.ImageAboveText;
btn.Click += new EventHandler(menu_Click);
ts.Items.Add(btn);
}
}
}
catch (System.Exception ex)
{
//ToDo:Log Message
Trace.WriteLine("Error:" + ex.Message + ex.StackTrace);
}
}
ts.ResumeLayout(false);
ts.PerformLayout();
}
示例14: InitializeComponent
//.........这里部分代码省略.........
helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
helpToolStripButton.Name = "helpToolStripButton";
helpToolStripButton.Size = new System.Drawing.Size(23, 22);
helpToolStripButton.Text = "He&lp";
helpToolStripButton.Visible = false;
//
// imageList1
//
imageList1.ImageStream = ((ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
imageList1.TransparentColor = System.Drawing.Color.Magenta;
imageList1.Images.SetKeyName(0, "ellipse.bmp");
imageList1.Images.SetKeyName(1, "rectangle.bmp");
imageList1.Images.SetKeyName(2, "Simple.bmp");
imageList1.Images.SetKeyName(3, "Point1.bmp");
imageList1.Images.SetKeyName(4, "Point2.bmp");
//
// fColorDialog
//
fColorDialog.AnyColor = true;
//
// fontDialog1
//
fontDialog1.FontMustExist = true;
//
// bColorDialog
//
bColorDialog.AnyColor = true;
bColorDialog.Color = System.Drawing.Color.White;
//
// printDocument1
//
printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintDocument1PrintPage);
//
// printDialog1
//
printDialog1.Document = printDocument1;
printDialog1.UseEXDialog = true;
//
// printPreviewDialog1
//
printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
printPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300);
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.Enabled = true;
printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
printPreviewDialog1.Name = "printPreviewDialog1";
printPreviewDialog1.Visible = false;
//
// openFileDialog1
//
openFileDialog1.DefaultExt = "xml";
openFileDialog1.FileName = "openFileDialog1";
openFileDialog1.Filter = "File xml (*.xml)|*.xml|Tutti i files (*.*)|*.*";
//
// saveFileDialog1
//
saveFileDialog1.DefaultExt = "xml";
saveFileDialog1.FileName = "diagram";
saveFileDialog1.Filter = "File xml (*.xml)|*.xml|Tutti i files (*.*)|*.*";
saveFileDialog1.RestoreDirectory = true;
//
// saveFileDialog2
//
saveFileDialog2.FileName = "export";
saveFileDialog2.Filter = "File png (*.png)|*.png|File jpeg (*.jpg,*.jpeg)|*.jpg,*.jpeg|File bitmap (*.bmp)|" +
"*.bmp|File gif (*.gif)|*.gif|File tiff (*.tif,*.tiff)|*.tif,*.tiff";
saveFileDialog2.RestoreDirectory = true;
//
// borderColorDialog
//
borderColorDialog.AnyColor = true;
//
// saveFileDialog3
//
saveFileDialog3.DefaultExt = "svg";
saveFileDialog3.Filter = "File svg (*.svg)|*.svg|Tutti i files (*.*)|*.*";
//
// MainForm
//
ClientSize = new System.Drawing.Size(804, 578);
Controls.Add(toolStripContainer1);
MainMenuStrip = menuStrip1;
Name = "MainForm";
Text = "Diagram Drawer";
FormClosing += new FormClosingEventHandler(MainForm_FormClosing);
toolStripContainer1.ContentPanel.ResumeLayout(false);
toolStripContainer1.ContentPanel.PerformLayout();
toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
toolStripContainer1.TopToolStripPanel.PerformLayout();
toolStripContainer1.ResumeLayout(false);
toolStripContainer1.PerformLayout();
panel1.ResumeLayout(false);
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
ResumeLayout (false);
}
示例15: CreateToolsPanel
private void CreateToolsPanel()
{
ToolStrip toolStrip1 = new ToolStrip();
toolStrip1.SuspendLayout();
toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 1", (sender, eventArgs) => ActiveTabPanel(0)));
toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 2", (sender, eventArgs) => ActiveTabPanel(1)));
toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 3", (sender, eventArgs) => ActiveTabPanel(2)));
toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 4", (sender, eventArgs) => ActiveTabPanel(3)));
toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 5", (sender, eventArgs) => ActiveTabPanel(4)));
toolStrip1.ResumeLayout(false);
_toolsPanel.Controls.Add(toolStrip1);
}