当前位置: 首页>>代码示例>>C#>>正文


C# ToolBar.SuspendLayout方法代码示例

本文整理汇总了C#中System.Windows.Forms.ToolBar.SuspendLayout方法的典型用法代码示例。如果您正苦于以下问题:C# ToolBar.SuspendLayout方法的具体用法?C# ToolBar.SuspendLayout怎么用?C# ToolBar.SuspendLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ToolBar的用法示例。


在下文中一共展示了ToolBar.SuspendLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitToolbar

		private void InitToolbar()
		{
			bool bResumeLayout=false;
			// Clear out anything from before
			if (mainTB != null)
			{
				this.SuspendLayout();
				mainTB.SuspendLayout();
				bResumeLayout=true;
				mainTB.Controls.Clear();
				if (ctlBold!=null) {ctlBold=null;}
				if (ctlItalic!=null) {ctlItalic=null;}
				if (ctlUnderline!=null) {ctlUnderline=null;}
				if (ctlFont!=null) {ctlFont=null;}
				if (ctlFontSize!=null) {ctlFontSize=null;}
				if (ctlForeColor!=null) {ctlForeColor=null;}
				if (ctlBackColor!=null) {ctlBackColor=null;}
				if (ctlNew!=null) {ctlNew=null;}
				if (ctlOpen!=null) {ctlOpen=null;}
				if (ctlSave!=null) {ctlSave=null;}
				if (ctlCut!=null) {ctlCut=null;}
				if (ctlCopy!=null) {ctlCopy=null;}
				if (ctlUndo!=null) {ctlUndo=null;}
				if (ctlPaste!=null) {ctlPaste=null;}
				if (ctlPrint!=null) {ctlPrint=null;}
				if (ctlPdf!=null) {ctlPdf=null;}
				if (ctlXml!=null) {ctlXml=null;}
				if (ctlHtml!=null) {ctlHtml=null;}
				if (ctlMht!=null) {ctlMht=null;}
				if (ctlZoom!=null) {ctlZoom=null;}
				if (ctlInsertCurrent!=null) {ctlInsertCurrent=null;}
				if (ctlInsertTextbox!=null) {ctlInsertTextbox=null;}
				if (ctlInsertChart!=null) {ctlInsertChart=null;}
				if (ctlInsertRectangle!=null) {ctlInsertRectangle=null;}
				if (ctlInsertTable!=null) {ctlInsertTable=null;}
				if (ctlInsertMatrix!=null) {ctlInsertMatrix=null;}
				if (ctlInsertList!=null) {ctlInsertList=null;}
				if (ctlInsertLine!=null) {ctlInsertLine=null;}
				if (ctlInsertImage!=null) {ctlInsertImage=null;}
				if (ctlInsertSubreport!=null) {ctlInsertSubreport=null;}
				if (ctlEditTextbox!=null){ctlEditTextbox=null;}
				if (ctlEditLabel!=null){ctlEditLabel=null;}
			}
			else
			{
				mainTB = new ToolBar();
                mainTB.SizeChanged += new EventHandler(mainTB_SizeChanged);
				mainTB.SuspendLayout();
			}
			const int LINEHEIGHT = 22;
			const int LEFTMARGIN = 5;
			int y = 2;
			int x = LEFTMARGIN;

			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(RdlDesigner));

			// Build the controls the user wants
			foreach (string tbi in _Toolbar)
			{
				switch (tbi)
				{
					case "\n":
					case "Newline":
						y += LINEHEIGHT;
						x = LEFTMARGIN;
						break;
					case "Bold":
						x += InitToolbarBold(x,y);
						break;
					case "Italic":
						x += InitToolbarItalic(x,y);
						break;
					case "Underline":
						x += InitToolbarUnderline(x,y);
						break;
					case "Space":
						x += 5;
						break;
					case "Font":
						x += InitToolbarFont(x,y);
						break;
					case "FontSize":
						x += InitToolbarFontSize(x,y);
						break;
					case "ForeColor":
						ctlForeColor = InitToolbarColor(ref x, y, "Fore Color");
						ctlForeColor.SelectedValueChanged +=new EventHandler(ctlForeColor_Change);
						ctlForeColor.Validated +=new EventHandler(ctlForeColor_Change);
						break;
					case "BackColor":
						ctlBackColor = InitToolbarColor(ref x, y, "Back Color");
						ctlBackColor.SelectedValueChanged +=new EventHandler(ctlBackColor_Change);
						ctlBackColor.Validated +=new EventHandler(ctlBackColor_Change);
						break;
					case "New":
						ctlNew = InitToolbarMenu(ref x, y, "New", bNew.Image, new EventHandler(this.menuFileNewReport_Click));
						break;
					case "Open":
						ctlOpen = InitToolbarMenu(ref x, y, "Open", bOpen.Image, new EventHandler(this.menuFileOpen_Click));
						break;
//.........这里部分代码省略.........
开发者ID:romeroyonatan,项目名称:opendental,代码行数:101,代码来源:RdlDesigner.cs


注:本文中的System.Windows.Forms.ToolBar.SuspendLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。