[英]How do I redirect a checkbox to another page in my app if checked Xamarin Android C#?
I am making an android app using C# in Xamarin studio. 我正在Xamarin Studio中使用C#制作一个android应用。 I managed to make the checkboxes and among other things.
我设法使复选框等。 I need to know what code I would need to use make a the checkbox go to redirect to another page if checked.
我需要知道使用什么代码,如果选中该复选框,将复选框转到重定向到另一个页面。 I am new to programming so I am sure this is an easy question but I am having trouble.
我是编程新手,所以我敢肯定这是一个简单的问题,但我遇到了麻烦。
This is what you need to do 这就是你要做的
private void MainPage_Load(object sender, EventArgs e)
{
checkBox1.CheckedChanged += checkBox1_CheckedChanged;
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
// your code to go to the other page.
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.