本文整理匯總了C#中System.Windows.Forms.ComboBox.PopulateFromEnum方法的典型用法代碼示例。如果您正苦於以下問題:C# ComboBox.PopulateFromEnum方法的具體用法?C# ComboBox.PopulateFromEnum怎麽用?C# ComboBox.PopulateFromEnum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.ComboBox
的用法示例。
在下文中一共展示了ComboBox.PopulateFromEnum方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PSXControllerConfig_Load
private void PSXControllerConfig_Load(object sender, EventArgs e)
{
var psxSettings = ((Octoshock)Global.Emulator).GetSyncSettings();
for (int i = 0; i < psxSettings.Controllers.Length; i++)
{
Controls.Add(new Label
{
Text = "Controller " + (i + 1),
Location = new Point(15, 19 + (i * 25)),
Width = 85
});
Controls.Add(new CheckBox
{
Text = "Connected",
Name = "Controller" + i,
Location = new Point(105, 15 + (i * 25)),
Checked = psxSettings.Controllers[i].IsConnected,
Width = 90
});
var dropdown = new ComboBox
{
Name = "Controller" + i,
DropDownStyle = ComboBoxStyle.DropDownList,
Location = new Point(200, 15 + (i * 25))
};
dropdown.PopulateFromEnum<Octoshock.ControllerSetting.ControllerType>(psxSettings.Controllers[i].Type);
Controls.Add(dropdown);
}
}