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


C# Button.SetFocus方法代码示例

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


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

示例1: WidgetFocus

		public WidgetFocus ()
		{
			var text = new TextEntry ();
			var check = new CheckBox ("CheckBox");
			var slider = new HSlider ();
			ListStore store = new ListStore (value);
			var list = new ListView (store);
			list.Columns.Add ("Value", value);
			list.HeadersVisible = false;
			for (int n=0; n<10; n++) {
				var r = store.AddRow ();
				store.SetValue (r, value, "Value " + n);
			}

			var btn1 = new Button ("TextEnty");
			var btn2 = new Button ("Checkbox");
			var btn3 = new Button ("Slider");
			var btn4 = new Button ("ListBox");
			var btn5 = new Button ("Button");

			btn1.Clicked += (sender, e) => text.SetFocus ();
			btn2.Clicked += (sender, e) => check.SetFocus ();
			btn3.Clicked += (sender, e) => slider.SetFocus ();
			btn4.Clicked += (sender, e) => list.SetFocus ();
			btn5.Clicked += (sender, e) => btn1.SetFocus ();

			var btnBox = new HBox ();
			btnBox.PackStart (btn1);
			btnBox.PackStart (btn2);
			btnBox.PackStart (btn3);
			btnBox.PackStart (btn4);
			btnBox.PackStart (btn5);

			var focusBox = new HBox ();
			var vbox = new VBox ();
			vbox.PackStart (text);
			vbox.PackStart (check);
			vbox.PackStart (slider);
			focusBox.PackStart (vbox);
			focusBox.PackStart (list, true);

			PackStart (btnBox);
			PackStart (focusBox, true);
		}
开发者ID:m13253,项目名称:xwt,代码行数:44,代码来源:WidgetFocus.cs

示例2: Options

        public override Widget Options()
        {
            if (main != null) {
                main.Dispose();
            }

            main = new VBox();

            // filename
            HBox file = new HBox();
            filenameEntry = new TextEntry();
            filenameEntry.Text = Filename;
            filenameEntry.ReadOnly = true;
            filenameEntry.ShowFrame = false;
            filenameEntry.BackgroundColor = Color.FromBytes(232, 232, 232);

            Button browseButton = new Button("Browse...");
            browseButton.SetFocus();
            browseButton.Clicked += Browse;

            // print to std out
            HBox exportToStdOutBox = new HBox();
            CheckBox exportTSCheck = new CheckBox();

            exportToStdOutBox.PackStart(new Label("Export to standard out?"));
            exportToStdOutBox.PackEnd(exportTSCheck);
            exportTSCheck.Toggled += delegate {
                if (exportTSCheck.Active) {
                    browseButton.Style = ButtonStyle.Flat;
                    browseButton.Clicked -= Browse;
                    exportToStdOut = true;
                } else {
                    browseButton.Style = ButtonStyle.Normal;
                    browseButton.Clicked += Browse;
                    exportToStdOut = false;
                }
            };

            file.PackStart(filenameEntry, true);
            file.PackEnd(browseButton);

            main.PackEnd(file, true);
            main.PackEnd(exportToStdOutBox, true);

            return main;
        }
开发者ID:jfreax,项目名称:BAIMP,代码行数:46,代码来源:Arff.cs


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