本文整理汇总了C#中System.Windows.Forms.ToolStrip.PerformLayout方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStrip.PerformLayout方法的具体用法?C# ToolStrip.PerformLayout怎么用?C# ToolStrip.PerformLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStrip
的用法示例。
在下文中一共展示了ToolStrip.PerformLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Size2
public void Size2 ()
{
Form f = new Form ();
f.ShowInTaskbar = false;
f.Show ();
ToolStrip ts = new ToolStrip ();
f.Controls.Add (ts);
ToolStripOverflowButton tsi = ts.OverflowButton;
Assert.AreEqual (new Size (16, 25), tsi.Size, "B1");
Assert.AreEqual (false, tsi.Visible, "B3");
ToolStripItem test = ts.Items.Add ("test");
test.Overflow = ToolStripItemOverflow.Always;
ts.PerformLayout ();
Assert.AreEqual (Size.Empty, tsi.Size, "B2");
f.Hide ();
}
示例2: OnParentChanged
protected virtual void OnParentChanged (ToolStrip oldParent, ToolStrip newParent)
{
this.text_size = TextRenderer.MeasureText (this.Text == null ? string.Empty : this.text, this.Font, Size.Empty, TextFormatFlags.HidePrefix);
if (oldParent != null)
oldParent.PerformLayout ();
if (newParent != null)
newParent.PerformLayout ();
}
示例3: ChangeIconSize
public static void ChangeIconSize(ToolStrip toolStrip, IconSize iconSize)
{
toolStrip.SuspendLayout();
toolStrip.ImageScalingSize = StandardIconSizes.GetSize(iconSize);
ChangeIconSize(toolStrip.Items, iconSize);
toolStrip.ResumeLayout(false);
toolStrip.PerformLayout();
}
示例4: addXuatRaFileItem
/// <summary>
/// Gắn item Xuất dữ liệu ra excel và gắn vào toolStrip.
/// Dùng trong Quản lý Danh Mục
/// </summary>
public static ToolStripDropDownButton addXuatRaFileItem(ToolStrip toolStripBar, GridView gridView)
{
toolStripBar.SuspendLayout();
ToolStripDropDownButton xuatRaFile = new System.Windows.Forms.ToolStripDropDownButton();
xuatRaFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
xuatRaFile.Image = FWImageDic.EXPORT_TO_FILE_IMAGE20;
xuatRaFile.ImageTransparentColor = System.Drawing.Color.Magenta;
xuatRaFile.Name = "xuatRaFile";
xuatRaFile.Size = new System.Drawing.Size(200, 20);
xuatRaFile.Text = "Xuất ra file";
ToolStripMenuItem itemXuatRaExcel2007 = new ToolStripMenuItem("Xuất ra file Excel 2007");
itemXuatRaExcel2007.Name = "itemXuatRaExcel2007";
itemXuatRaExcel2007.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemXuatRaExcel2007.Size = new System.Drawing.Size(200, 20);
itemXuatRaExcel2007.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "xlsx");
};
xuatRaFile.DropDownItems.Add(itemXuatRaExcel2007);
ToolStripMenuItem itemXuatRaExcel2003 = new ToolStripMenuItem("Xuất ra file Excel 97 - 2003");
itemXuatRaExcel2003.Name = "itemXuatRaExcel2003";
itemXuatRaExcel2003.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemXuatRaExcel2003.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "xls");
};
xuatRaFile.DropDownItems.Add(itemXuatRaExcel2003);
ToolStripMenuItem itemXuatRaPDF = new ToolStripMenuItem("Xuất ra file PDF");
itemXuatRaPDF.Name = "itemXuatRaPDF";
itemXuatRaPDF.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemXuatRaPDF.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "pdf");
};
xuatRaFile.DropDownItems.Add(itemXuatRaPDF);
ToolStripMenuItem itemXuatRaHTML = new ToolStripMenuItem("Xuất ra file HTML");
itemXuatRaHTML.Name = "itemXuatRaHTML";
itemXuatRaHTML.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemXuatRaHTML.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "htm");
};
xuatRaFile.DropDownItems.Add(itemXuatRaHTML);
ToolStripMenuItem itemXuatRaRTF = new ToolStripMenuItem("Xuất ra file RTF");
itemXuatRaRTF.Name = "itemXuatRaRTF";
itemXuatRaRTF.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemXuatRaRTF.Click += delegate(object sender, EventArgs e)
{
HelpGrid.exportFile(gridView, "rtf");
};
xuatRaFile.DropDownItems.Add(itemXuatRaRTF);
toolStripBar.Items.Add(xuatRaFile);
toolStripBar.ResumeLayout(false);
toolStripBar.PerformLayout();
return xuatRaFile;
}
示例5: FillToolbar
/// <summary>
/// returns true if it made any changes.
/// </summary>
private void FillToolbar(ChoiceGroup choiceGroup, ToolStrip toolStrip)
{
bool wantsSeparatorBefore = false;
choiceGroup.PopulateNow();
if (!DoesToolStripNeedRegenerating(choiceGroup, toolStrip))
return;
// Don't let the GC run dispose.
for(int i = toolStrip.Items.Count - 1; i >= 0; --i)
{
toolStrip.Items[i].Dispose();
}
toolStrip.Items.Clear();
foreach(ChoiceRelatedClass item in choiceGroup)
{
if(item is SeparatorChoice)
{
wantsSeparatorBefore = true;
}
else if (item is ChoiceBase)
{
UIItemDisplayProperties displayProperties = item.GetDisplayProperties();
bool reallyVisible;
ToolStripItem toolStripItem = CreateButtonItem(item as ChoiceBase, out reallyVisible);
//toolStripItem.ToolTipText = item.Label; // TODO-Linux: add shortcut accessolrator here. // choiceBase.Shortcut. //maybe this should be done by CreateButtonItem?
toolStripItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
if (wantsSeparatorBefore && displayProperties != null && displayProperties.Visible)
{
var separator = new ToolStripSeparator();
separator.AccessibilityObject.Name = "separator";
// separator.GetType().Name;
toolStrip.Items.Add(separator);
}
wantsSeparatorBefore = false;
toolStrip.Items.Add(toolStripItem);
}
else if (item is ChoiceGroup)
{
ToolStripComboBox toolStripItem = CreateComboBox(item as ChoiceGroup, true);
toolStrip.Items.Add(toolStripItem);
}
else
{
//debugging
continue;
}
}
toolStrip.PerformLayout();
return;
}
示例6: 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;
}
示例7: addNhapTuFileItem
public static ToolStripDropDownButton addNhapTuFileItem(ToolStrip toolStripBar, GridView gridView)
{
toolStripBar.SuspendLayout();
ToolStripDropDownButton nhapTuFile = new System.Windows.Forms.ToolStripDropDownButton();
nhapTuFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
nhapTuFile.Image = FWImageDic.EXPORT_TO_FILE_IMAGE20;
nhapTuFile.ImageTransparentColor = System.Drawing.Color.Magenta;
nhapTuFile.Name = "nhapTuFile";
nhapTuFile.Size = new System.Drawing.Size(200, 20);
nhapTuFile.Text = "Nhập từ file";
ToolStripMenuItem itemTemplate = new ToolStripMenuItem("Tạo định dạng file nhập");
itemTemplate.Name = "taoDinhDangNhap";
itemTemplate.DisplayStyle = ToolStripItemDisplayStyle.Text;
itemTemplate.Size = new System.Drawing.Size(200, 20);
nhapTuFile.DropDownItems.Add(itemTemplate);
ToolStripMenuItem itemChonFile = new ToolStripMenuItem("Chọn file để nhập");
itemChonFile.Name = "chonFileNhap";
itemChonFile.DisplayStyle = ToolStripItemDisplayStyle.Text;
nhapTuFile.DropDownItems.Add(itemChonFile);
ToolStripSeparator InLuoiSep = new System.Windows.Forms.ToolStripSeparator();
InLuoiSep.Name = "InLuoiSep";
InLuoiSep.Size = new System.Drawing.Size(200, 20);
toolStripBar.Items.Add(InLuoiSep);
toolStripBar.Items.Add(nhapTuFile);
toolStripBar.ResumeLayout(false);
toolStripBar.PerformLayout();
return nhapTuFile;
}
示例8: 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();
}
示例9: 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;
}
示例10: 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);
}
示例11: 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();
}
示例12: 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);
}
示例13: MoveOutsideContainer
private void MoveOutsideContainer(ToolStrip toolStripToDrag, Point screenLocation)
{
ToolStripPanel controlToLayout = ToolStripManager.ToolStripPanelFromPoint(toolStripToDrag, screenLocation);
if (controlToLayout != null)
{
using (new LayoutTransaction(controlToLayout, controlToLayout, null))
{
controlToLayout.MoveControl(toolStripToDrag, screenLocation);
}
toolStripToDrag.PerformLayout();
}
else
{
this.GiveToolStripPanelFeedback(toolStripToDrag, screenLocation);
}
}
示例14: InitializeComponent
//.........这里部分代码省略.........
this.tsbFindPage.Size = new System.Drawing.Size(28, 28);
this.tsbFindPage.Text = "Find Current Page in Tree";
this.tsbFindPage.ToolTipText = "Find Current Page in Tree";
this.tsbFindPage.Click += new System.EventHandler(this.FindInTreeButton);
//
// tsbRefresh
//
this.tsbRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbRefresh.Image = ((System.Drawing.Image)(resources.GetObject("tsbRefresh.Image")));
this.tsbRefresh.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.tsbRefresh.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tsbRefresh.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbRefresh.Name = "tsbRefresh";
this.tsbRefresh.Size = new System.Drawing.Size(28, 28);
this.tsbRefresh.Text = "Refresh";
this.tsbRefresh.Click += new System.EventHandler(this.RefreshViewButton);
//
// tsWorkingSet
//
this.tsWorkingSet.AllowItemReorder = true;
this.tsWorkingSet.BackColor = System.Drawing.Color.White;
this.tsWorkingSet.Dock = System.Windows.Forms.DockStyle.None;
this.tsWorkingSet.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbAddWorkingSet,
this.tsbRemoveWorkingSet,
this.tsbAddLink,
this.tsbRemoveLink});
this.tsWorkingSet.Location = new System.Drawing.Point(3, 0);
this.tsWorkingSet.Name = "tsWorkingSet";
this.tsWorkingSet.Size = new System.Drawing.Size(124, 31);
this.tsWorkingSet.TabIndex = 1;
//
// tsbAddWorkingSet
//
this.tsbAddWorkingSet.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbAddWorkingSet.Image = ((System.Drawing.Image)(resources.GetObject("tsbAddWorkingSet.Image")));
this.tsbAddWorkingSet.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tsbAddWorkingSet.ImageTransparentColor = System.Drawing.Color.Black;
this.tsbAddWorkingSet.Name = "tsbAddWorkingSet";
this.tsbAddWorkingSet.Size = new System.Drawing.Size(28, 28);
this.tsbAddWorkingSet.Text = "Add Favorites Folder";
this.tsbAddWorkingSet.ToolTipText = "Add Favorites Folder";
this.tsbAddWorkingSet.Click += new System.EventHandler(this.tsbAddWorkingSet_Click);
//
// tsbRemoveWorkingSet
//
this.tsbRemoveWorkingSet.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbRemoveWorkingSet.Image = ((System.Drawing.Image)(resources.GetObject("tsbRemoveWorkingSet.Image")));
this.tsbRemoveWorkingSet.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tsbRemoveWorkingSet.ImageTransparentColor = System.Drawing.Color.Black;
this.tsbRemoveWorkingSet.Name = "tsbRemoveWorkingSet";
this.tsbRemoveWorkingSet.Size = new System.Drawing.Size(28, 28);
this.tsbRemoveWorkingSet.Text = "Remove Favorites Folder";
this.tsbRemoveWorkingSet.Click += new System.EventHandler(this.tsbRemoveWorkingSet_Click);
//
// tsbAddLink
//
this.tsbAddLink.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbAddLink.Image = ((System.Drawing.Image)(resources.GetObject("tsbAddLink.Image")));
this.tsbAddLink.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tsbAddLink.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbAddLink.Name = "tsbAddLink";
this.tsbAddLink.Size = new System.Drawing.Size(28, 28);
this.tsbAddLink.Text = "Add Link";
this.tsbAddLink.Click += new System.EventHandler(this.tsbAddLink_Click);
//
// tsbRemoveLink
//
this.tsbRemoveLink.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbRemoveLink.Image = ((System.Drawing.Image)(resources.GetObject("tsbRemoveLink.Image")));
this.tsbRemoveLink.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.tsbRemoveLink.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tsbRemoveLink.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbRemoveLink.Name = "tsbRemoveLink";
this.tsbRemoveLink.Size = new System.Drawing.Size(28, 28);
this.tsbRemoveLink.Text = "Remove Link";
this.tsbRemoveLink.Click += new System.EventHandler(this.tsbRemoveLink_Click);
//
// MainForm
//
this.ClientSize = new System.Drawing.Size(237, 564);
this.Controls.Add(this.toolContainer);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "OneNote TreeView";
this.Load += new System.EventHandler(this.MainForm_Load);
tsRoot.ResumeLayout(false);
tsRoot.PerformLayout();
this.toolContainer.BottomToolStripPanel.ResumeLayout(false);
this.toolContainer.BottomToolStripPanel.PerformLayout();
this.toolContainer.TopToolStripPanel.ResumeLayout(false);
this.toolContainer.TopToolStripPanel.PerformLayout();
this.toolContainer.ResumeLayout(false);
this.toolContainer.PerformLayout();
this.tsMisc.ResumeLayout(false);
this.tsMisc.PerformLayout();
this.tsWorkingSet.ResumeLayout(false);
this.tsWorkingSet.PerformLayout();
this.ResumeLayout(false);
}
示例15: InitializeComponent
//.........这里部分代码省略.........
toolStrip2.Items.AddRange(new ToolStripItem[] { toolStripButton10, toolStripSeparator5, toolStripComboBox1, toolStripComboBox2, toolStripTextBox2, toolStripButton11, toolStripButton13, toolStripSeparator2, toolStripProgressBar1, toolStripLabel1 });
toolStrip2.Location = new Point(0, 0x30);
toolStrip2.Name = "toolStrip2";
toolStrip2.Size = new Size(0x29f, 0x19);
toolStrip2.TabIndex = 10;
toolStrip2.Text = "Acquisition toolbar";
toolStripButton10.DisplayStyle = ToolStripItemDisplayStyle.Image;
toolStripButton10.Image = Resources.Connect;
toolStripButton10.ImageTransparentColor = Color.Magenta;
toolStripButton10.Name = "toolStripButton10";
toolStripButton10.Size = new Size(0x17, 0x16);
toolStripButton10.Text = "Connect";
toolStripButton10.ToolTipText = "Connect/Disconnect";
toolStripSeparator5.Name = "toolStripSeparator5";
toolStripSeparator5.Size = new Size(6, 0x19);
toolStripComboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
toolStripComboBox1.Items.AddRange(new object[] { "1", "10", "25", "50" });
toolStripComboBox1.Name = "toolStripComboBox1";
toolStripComboBox1.Size = new Size(0x4b, 0x19);
toolStripComboBox1.ToolTipText = "Data acquisition frequency (Hz)";
toolStripComboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
toolStripComboBox2.Items.AddRange(new object[] { "Samples", "Continous" });
toolStripComboBox2.Name = "toolStripComboBox2";
toolStripComboBox2.Size = new Size(90, 0x19);
toolStripComboBox2.ToolTipText = "Acquisition Mode";
toolStripButton11.DisplayStyle = ToolStripItemDisplayStyle.Image;
toolStripButton11.Image = Resources.StartAcquistion;
toolStripButton11.ImageTransparentColor = Color.Magenta;
toolStripButton11.Name = "toolStripButton11";
toolStripButton11.Size = new Size(0x17, 0x16);
toolStripButton11.Text = "Start";
toolStripButton13.DisplayStyle = ToolStripItemDisplayStyle.Image;
toolStripButton13.Image = Resources.StopAcquistion;
toolStripButton13.ImageTransparentColor = Color.Magenta;
toolStripButton13.Name = "toolStripButton13";
toolStripButton13.Size = new Size(0x17, 0x16);
toolStripButton13.Text = "Stop";
toolStripSeparator2.Name = "toolStripSeparator2";
toolStripSeparator2.Size = new Size(6, 0x19);
toolStripProgressBar1.Name = "toolStripProgressBar1";
toolStripProgressBar1.Size = new Size(100, 0x16);
toolStripProgressBar1.Step = 2;
toolStripProgressBar1.Style = ProgressBarStyle.Continuous;
toolStripProgressBar1.ToolTipText = "Acquisition progress";
menuStrip1.Items.AddRange(new ToolStripItem[] { Communication });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(200, 0x18);
menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1";
Communication.DropDownItems.AddRange(new ToolStripItem[] { Connect, Acquisition, Settings });
Communication.Name = "Communication";
Communication.Size = new Size(0x5b, 20);
Communication.Text = "Communication";
Connect.Name = "Connect";
Connect.Size = new Size(0x88, 0x16);
Connect.Text = "Connect";
Acquisition.DropDownItems.AddRange(new ToolStripItem[] { Samples, Continous, toolStripSeparator1, Start, Stop });
Acquisition.Name = "Acquisition";
Acquisition.Size = new Size(0x88, 0x16);
Acquisition.Text = "Acquisition";
Samples.Checked = true;
Samples.CheckState = CheckState.Checked;
Samples.Name = "Samples";
Samples.Size = new Size(0x85, 0x16);
Samples.Text = "Samples";
Continous.Name = "Continous";
Continous.Size = new Size(0x85, 0x16);
Continous.Text = "Continous";
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(130, 6);
Start.Name = "Start";
Start.Size = new Size(0x85, 0x16);
Start.Text = "Start";
Stop.Name = "Stop";
Stop.Size = new Size(0x85, 0x16);
Stop.Text = "Stop";
Settings.Name = "Settings";
Settings.Size = new Size(0x88, 0x16);
Settings.Text = "Settings...";
timer1.Tick += new EventHandler(timer1_Tick);
toolStripLabel1.AutoSize = false;
toolStripLabel1.BackColor = SystemColors.Info;
toolStripLabel1.Name = "toolStripLabel1";
toolStripLabel1.Size = new Size(70, 0x16);
toolStripLabel1.TextAlign = ContentAlignment.MiddleRight;
toolStripLabel1.ToolTipText = "Number of samples";
toolStripTextBox2.AcceptOnlyNumber = true;
toolStripTextBox2.MaxLength = 5;
toolStripTextBox2.MaxValue = 0xffffL;
toolStripTextBox2.MinValue = 1L;
toolStripTextBox2.Name = "toolStripTextBox2";
toolStripTextBox2.Size = new Size(80, 0x15);
toolStripTextBox2.TextBoxAlign = HorizontalAlignment.Right;
toolStripTextBox2.ToolTipText = "Number of samples (Max 65535)";
toolStrip2.ResumeLayout(false);
toolStrip2.PerformLayout();
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
}