本文整理汇总了C#中RadioButton.SetChecked方法的典型用法代码示例。如果您正苦于以下问题:C# RadioButton.SetChecked方法的具体用法?C# RadioButton.SetChecked怎么用?C# RadioButton.SetChecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RadioButton
的用法示例。
在下文中一共展示了RadioButton.SetChecked方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle savedInstance)
{
base.OnCreate(savedInstance);
SetContentView(R.Layouts.SettingActivityLayout);
ActionBar actionBar = GetActionBar();
// To enable the icon for up navigation (which displays the "up" indicator next to the icon)
actionBar.SetDisplayHomeAsUpEnabled(true);
gamePreferences = new Preferences();
gamePreferences.RetrievePreferences(GetSharedPreferences("GamePreferences", MODE_MULTI_PROCESS));
txtV = FindViewById<TextView>(R.Ids.tableChoosen);
txtV1 = FindViewById<TextView>(R.Ids.tableChoosenTxt);
seekbar = FindViewById<SeekBar>(R.Ids.seekbar);
seekbar.ProgressChanged += new EventHandler<ProgressChangedEventArgs>(seekbar_ProgressChanged);
seekbar.SetProgress(gamePreferences.TableOf);
var btn = FindViewById<Button>(R.Ids.Ok);
btn.Click += new EventHandler(btn_ClickOk);
btn = FindViewById<Button>(R.Ids.Cancel);
btn.Click += new EventHandler(btn_ClickCancel);
swV = FindViewById<Switch>(R.Ids.isRandom);
swV.CheckedChanged += new EventHandler<CheckedChangedEventArgs>(swV_CheckedChanged);
swV.SetChecked(!gamePreferences.RandomQuestions);
rbtnTo10 = FindViewById<RadioButton>(R.Ids.To10);
if (gamePreferences.UpperLimit == 10)
{
rbtnTo10.SetChecked(true);
}
rbtnTo50 = FindViewById<RadioButton>(R.Ids.To50);
if (gamePreferences.UpperLimit == 50)
{
rbtnTo50.SetChecked(true);
}
rbtnTo100 = FindViewById<RadioButton>(R.Ids.To100);
if (gamePreferences.UpperLimit == 100)
{
rbtnTo100.SetChecked(true);
}
rbtnTo500 = FindViewById<RadioButton>(R.Ids.To500);
if (gamePreferences.UpperLimit == 500)
{
rbtnTo500.SetChecked(true);
}
rbtnTo1000 = FindViewById<RadioButton>(R.Ids.To1000);
if (gamePreferences.UpperLimit == 1000)
{
rbtnTo1000.SetChecked(true);
}
rbtnTo10.CheckedChanged += new EventHandler<CheckedChangedEventArgs>(rbtnTo_CheckedChanged);
rbtnTo50.CheckedChanged += new EventHandler<CheckedChangedEventArgs>(rbtnTo_CheckedChanged);
rbtnTo100.CheckedChanged += new EventHandler<CheckedChangedEventArgs>(rbtnTo_CheckedChanged);
rbtnTo500.CheckedChanged += new EventHandler<CheckedChangedEventArgs>(rbtnTo_CheckedChanged);
rbtnTo1000.CheckedChanged += new EventHandler<CheckedChangedEventArgs>(rbtnTo_CheckedChanged);
rbtn0To10 = FindViewById<RadioButton>(R.Ids.With0To10);
if (gamePreferences.CounterMin == 0)
{
rbtn0To10.SetChecked(true);
}
rbtn10To20 = FindViewById<RadioButton>(R.Ids.With10To20);
if (gamePreferences.CounterMin == 10)
{
rbtn10To20.SetChecked(true);
}
rbtn20To50 = FindViewById<RadioButton>(R.Ids.With20To50);
if (gamePreferences.CounterMin == 20)
{
rbtn20To50.SetChecked(true);
}
rbtn50To100 = FindViewById<RadioButton>(R.Ids.With50To100);
if (gamePreferences.CounterMin == 50)
{
rbtn50To100.SetChecked(true);
}
EnabledButtons();
}