本文整理汇总了C#中Gtk.ComboBox.GrabFocus方法的典型用法代码示例。如果您正苦于以下问题:C# ComboBox.GrabFocus方法的具体用法?C# ComboBox.GrabFocus怎么用?C# ComboBox.GrabFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ComboBox
的用法示例。
在下文中一共展示了ComboBox.GrabFocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
private void Initialize ()
{
DefaultResponse = Gtk.ResponseType.Ok;
AddStockButton (Stock.Cancel, ResponseType.Cancel);
AddStockButton (Stock.Ok, ResponseType.Ok, true);
SetGeometryHints (this, new Gdk.Geometry () {
MinWidth = SizeRequest ().Width,
MaxWidth = Gdk.Screen.Default.Width,
MinHeight = -1,
MaxHeight = -1
}, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
var table = new Table (2, 2, false) {
RowSpacing = 12,
ColumnSpacing = 6
};
table.Attach (new Label () {
Text = Catalog.GetString ("Station _Type:"),
UseUnderline = true,
Xalign = 0.0f
}, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
table.Attach (arg_label = new Label () {
Xalign = 0.0f
}, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
table.Attach (type_combo = ComboBox.NewText (),
1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);
table.Attach (arg_entry = new Entry (),
1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);
VBox.PackStart (table, true, true, 0);
VBox.Spacing = 12;
VBox.ShowAll ();
type_combo.RemoveText (0);
int active_type = 0;
int i = 0;
foreach (StationType type in StationType.Types) {
if (!type.SubscribersOnly || lastfm.Account.Subscriber) {
type_combo.AppendText (type.Label);
if (source != null && type == source.Type) {
active_type = i;
}
i++;
}
}
type_combo.Changed += HandleTypeChanged;
type_combo.Active = active_type;
type_combo.GrabFocus ();
}