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


C# ComboBox.onSelection方法代码示例

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


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

示例1: buildGui

		public ascx_MediaWiki_PageEditor_Simple buildGui(O2MediaWikiAPI wikiApi)
		{			
			try
			{
				WikiApi = wikiApi;	
				
				
				var topPanel = this.add_Panel();						
			  	
			  	
			  	var horizontalSplitterPosition = topPanel.height()/2;
			  	var verticalSplitterPosition = topPanel.width()/2;
				var controls = topPanel.add_1x2("WikiText","Preview","Live (Current page)",false,horizontalSplitterPosition,verticalSplitterPosition); 
				WikiTextEditor = controls[0].add_RichTextBox();
				BrowserPreview = controls[1].add_WebBrowser();
				BrowserCurrent = controls[2].add_WebBrowser(); 
							
				WikiPage_TextBox = 	WikiTextEditor.insert_Above<TextBox>(50);	
				var bottomPanel = WikiPage_TextBox.insert_Below<Panel>(30);  			
				
				RecentChangesComboBox = WikiPage_TextBox.insert_Right<Panel>(290)
													    .add_Label("Recent Changes / Search")
													    .top(3)
													    .append_Control<ComboBox>()
													    //.dropDownList()						    
													    .width(150)
													    .top(0);
				Action<string> populateRecentChangesComboBox = 
					(filter) => {
									RecentChangesComboBox.backColor(Color.LightPink);								
									O2Thread.mtaThread(
										()=>{
												RecentChangesComboBox.clear();
												if (filter.valid().isFalse())
													RecentChangesComboBox.add_Items(WikiApi.recentPages());			  				
												else
													RecentChangesComboBox.add_Items(WikiApi.pages(filter));			  				
												RecentChangesComboBox.backColor(Color.White);												
											});
							  	};													    
				RecentChangesComboBox.onSelection(
		    		()=>{
		    				WikiPage_TextBox.set_Text(RecentChangesComboBox.get_Text());
		    				loadCurrentPage();
		    			});
		    	RecentChangesComboBox.onEnter(
		    		(text)=>{
		    					populateRecentChangesComboBox(text);	    					
		    				});
				//WikiTextEditor.insert_Below<ascx_LogViewer>(130);
																	
							
				//default values
				BrowserPreview.silent(true);
				BrowserCurrent.silent(true);
				//WikiPage_TextBox.set_Text("Test");			 			
				
				// add controls with events	 												
				
				CurrentPageUrl = BrowserCurrent.insert_Above<Panel>(20)
							 			        .add_LabelAndComboBoxAndButton("Current page","","open",showInCurrentBrowser)
							  					.controls<ComboBox>();
				
				
				CurrentPageUrl.insert_Item("www.google.com");			
				
				bottomPanel.add_Button("Load",0).onClick(
					()=>{		
							loadCurrentPage();						
						});
				
				
				bottomPanel.add_Button("Preview",0,100).onClick(
					()=>{						
							O2Thread.mtaThread( 
									()=>{
											BrowserPreview.set_Text(WikiApi.parseText(WikiTextEditor.get_Text(),true));
										});
						});
						
				SaveButton = bottomPanel.add_Button("Save",0,200).onClick(
								()=>{
										saveCurrentPage();		
									}); 
									
				StatusLabel = SaveButton.append_Label("").topAdd(3).autoSize();
				
				/*WikiTextEditor.onKeyPress(Keys.Enter, 
					(code)=>{
								O2Thread.mtaThread(()=>
								{			
									BrowserPreview.set_Text(WikiApi.parseText(code,true));
								});
							});*/
			
				WikiTextEditor.onKeyPress((key)=> 			// add suport to paste images form Clipboard
					{ 
						if (key == (Keys.Control | Keys.V))		
							return pasteImageFromClipboard();
						return false;
//.........这里部分代码省略.........
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:101,代码来源:ascx_MediaWiki_PageEditor_Simple.cs

示例2: buildGui

		//bool putJavaScriptCodeViewerOnTheLeft,
		public ascx_Javascript_AST buildGui( bool addUrlLoadTextBox)
		{
			var mainGui = this.add_1x1("Files or ScriptBlocks","Javascript Source (you can edit this code and see the results in realtime)");
			var splitContainer = this.controls<SplitContainer>();
			if (addUrlLoadTextBox)			
			{
				showJavascriptsFromUrl = 
				splitContainer.insert_Above<Panel>(25)
							  .add_LabelAndComboBoxAndButton("Enter Url to load Javascripts","","Open",  loadJavascriptsFromUrl)
							  .controls<ComboBox>();								  
			}
			/*if (putJavaScriptCodeViewerOnTheLeft)
			{				
				splitContainer.splitterDistance(this.width()/3);
				javascriptCode = mainGui[1].add_TreeView().showSelection().sort();
				sourceCode = mainGui[0].add_SourceCodeViewer(); 				
			}
			else			
			{*/
				javascriptCode = mainGui[0].add_TreeView().showSelection().sort();
				sourceCode = mainGui[1].add_SourceCodeViewer(); 
			//}
			pagesVisited = javascriptCode.insert_Above<ComboBox>(25).dropDownList();
			
			codeSnippet = sourceCode.insert_Below<TextBox>(100).multiLine().scrollBars(); 
			tabControl  = javascriptCode.insert_Below<TabControl>();
			
			jsAST = tabControl.add_Tab("Javascript - View Ast Tree")
								  .add_TreeView()
								  .showSelection();
								  
			jsFunctions = tabControl.add_Tab("JScript: Functions")
								  		.add_TreeView()
								  		.showSelection()
								  		.sort();
			
			jsIdentifiers = tabControl.add_Tab("JScript: Identifiers")
								  		  .add_TreeView()
								  		  .showSelection()
								  		  .sort();

			jsValues = tabControl.add_Tab("JScript: Values")
								  	 .add_TreeView()
								  	 .showSelection()
								  	 .sort();
								  		
			
			allAST = tabControl.add_Tab("Javascript - View Ast Elements")					    
								   .add_TreeView()
								   .showSelection()
								   .sort();
			
			var searchTab = tabControl.add_Tab("Search in Code")
									  .add_LabelAndComboBoxAndButton("search for (case sensitive)","","show",
									  	(text)=> {
									  				sourceCode.editor().invoke("searchForTextInTextEditor_findNext", text);
									  			 });
									  					  
			//tabControl.select_Tab(searchTab);
			javaScriptLoadMessage = javascriptCode.insert_Below<Panel>(20);
													  
			allAST.insert_Below<Panel>(25)
				  .add_CheckBox("Render this view (some performace impact on large scripts)", 0,0, 
				  		(value)=>{
				  					RenderViewAstElementsTreeView = value;
				  					processJavascript();
				  				 })
				  .autoSize(); 
				  
				  
			allAST.jint_configure_showSelectionDetails(sourceCode, codeSnippet); 
			jsFunctions.jint_configure_showSelectionDetails(sourceCode, codeSnippet); 
			jsIdentifiers.jint_configure_showSelectionDetails(sourceCode, codeSnippet); 
			jsValues.jint_configure_showSelectionDetails(sourceCode, codeSnippet); 

			javascriptCode.afterSelect<string>(
				(jsCode) => {
								sourceCode.editor().clearBookmarksAndMarkers();
								sourceCode.set_Text(jsCode,"*.js");
								sourceCode.editor().refresh(); 
							});
			
			sourceCode.onTextChanged(processJavascript);
			
			pagesVisited.onSelection<IE_HtmlPage>(
				(htmlPage)=>{
								var allScriptsCompiledOk = javascriptCode.populateWithHtmlPageScripts(htmlPage);
								javascriptCode.add_Node("zzz [Original Html Code for: {0}]".format(htmlPage.PageUri.str()),htmlPage.PageSource);
								handleCompilationResult(allScriptsCompiledOk);								
							});
							
			pagesVisited.onSelection<Jint_Wrapper>(
				(jintWrapper)=>{									
									var allScriptsCompiledOk = javascriptCode.populateWithHtmlPageScripts(jintWrapper.JavaScripts);
									javascriptCode.add_Node("zzz_[Original Code for: {0}]".format(jintWrapper.Uri.str()),jintWrapper.Html);
									handleCompilationResult(allScriptsCompiledOk);
							   });
			
			javascriptCode.onDrop(
//.........这里部分代码省略.........
开发者ID:paul-green,项目名称:O2.Platform.Scripts,代码行数:101,代码来源:ascx_Javascript_AST.cs


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