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


C# Control.width方法代码示例

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


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

示例1: syncGuiPositionWithControl

    	// this should only be executed once per Form
    	public static API_WebScarab syncGuiPositionWithControl(this API_WebScarab webScarab, Control control)
    	{
		    Action moveToControl = 
				()=>{
						webScarab.alwaysOnTop(true); 
						var xPos =  control.PointToScreen(System.Drawing.Point.Empty).X;
						var yPos =  control.PointToScreen(System.Drawing.Point.Empty).Y;
						var width = control.width();
						var height = control.height();
						webScarab.moveWindow(xPos, yPos, width, height);  
					};	
						
			control.parentForm().Move += 
				(sender,e)=> moveToControl();
			 
			control.Resize +=  
				(sender,e)=> moveToControl();
			moveToControl();							
			return webScarab;
		}
开发者ID:paul-green,项目名称:O2.Platform.Scripts,代码行数:21,代码来源:API_WebScarab.cs

示例2: showEditGui

        public Control showEditGui(Control hostControl, string title1, string title2, Func<List<string>> getContent)
        {   
        	hostControl.clear();
        	var usersGui = hostControl.add_1x1(title1,title2,true, hostControl.width()/3);
        	
        	var pageEditor = usersGui[1].add_Control<ascx_MediaWiki_PageEditor_Simple>().buildGui(WikiApi); 
        	
        	Action<Control> loadData = 
        		(control)=>{
        						control.clear();
        						control.enabled(false);
        						O2Thread.mtaThread(
        						()=>{        				
			        					var content = getContent();
			        					var treeView = control.add_TreeViewWithFilter(content)
			        					       				  .afterSelect<string>((userPage)=> pageEditor.openPage(userPage)); 
			        					addEditMenuItemsToTreeView(treeView);
			        					control.enabled(true);       
			        				});
        					};
        	
			        	
			        	
			usersGui[0].insert_Below<Panel>(20)
					   .add_Link("Reload data",0,0,
							()=> loadData(usersGui[0]))
						.click();
			return hostControl;						        
        }                
开发者ID:jobyjames85,项目名称:O2.Platform.Scripts,代码行数:29,代码来源:MediaWikiEditor.cs

示例3: createGui_EditUsingCategories

        public void createGui_EditUsingCategories(Control hostControl, string title1, string title2)
        {
        	hostControl.clear();
        	var usersGui = hostControl.add_1x1(title1,title2,true,hostControl.width()/3);
        	
        	var pageEditor = usersGui[1].Parent.clear().add_Control<ascx_MediaWiki_PageEditor_Simple>().buildGui(WikiApi); 
        	
			var controls = usersGui[0].Parent.clear().add_1x1("Category Names","Pages in Selected Category",false);
			var Categories_TreeView = controls[0].add_TreeView();
			var PagesInCategories_TreeView = controls[1].add_TreeView();

        	MethodInvoker loadData = 
        		()=>{
						//Categories_TreeView.clear();
						Categories_TreeView =  controls[0].add_TreeViewWithFilter(WikiApi.categoryPages())
														    .afterSelect<string>(
							(value)=>{
										PagesInCategories_TreeView = controls[1].add_TreeViewWithFilter(WikiApi.pagesInCategory(value))
														    					.afterSelect<string>((page)=>pageEditor.openPage(page));
									 
						
										pageEditor.openPage(value); 
										addEditMenuItemsToTreeView(PagesInCategories_TreeView);	
									 });
									 
						addEditMenuItemsToTreeView(Categories_TreeView);
						
					 };
						//PagesInCategories_TreeView.clear();
						//Categories_TreeView.add_Nodes(WikiApi.categoryPages());					
					
			controls[1].insert_Below<Panel>(20)
					   .add_Link("Reload data",0,0,()=> loadData())
						.click();        					 
        }
开发者ID:jobyjames85,项目名称:O2.Platform.Scripts,代码行数:35,代码来源:MediaWikiEditor.cs

示例4: resizeWindowToControlSize

		public static IntPtr resizeWindowToControlSize(this IntPtr handle, Control controlToSync, int x, int y)
		{
			if (handle != IntPtr.Zero)
            {
                var width = controlToSync.width();
                var height = controlToSync.height();                    
                handle.window_Move(x, y, width,height);
                "Setting window with handle {0} to {0}x{1} : {2}x{3}".info(handle, x, y, width, height);
            }
            return handle;                                
		}
开发者ID:paul-green,项目名称:O2.Platform.Scripts,代码行数:11,代码来源:API_WinAPI_ExtensionMethods.cs


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