Silverlight CheckBox获取选定的值 [英] Silverlight CheckBox Get Selected Value

查看:61
本文介绍了Silverlight CheckBox获取选定的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用

foreach(....)

foreach(....)

{

CheckBox

 

chkBox =
new
CheckBox

chkBox = new CheckBox

();

();

chkBox.Content =" Title";

chkBox.Content = "Title";

chkBox.Checked + =

chkBox.Checked +=

new
RoutedEventHandler

new RoutedEventHandler

(chkBox_Checked);

(chkBox_Checked);

chkBox.Unchecked + =

chkBox.Unchecked +=

new
RoutedEventHandler

new RoutedEventHandler

(chkBox_Unchecked);

(chkBox_Unchecked);

sPnl.Children.Add(chkBox);

sPnl.Children.Add(chkBox);

}

I
需要获取所选的复选框内容。我怎样才能获得。

任何
帮助我。

any one help me.

推荐答案

您好Dhansekar,

Hi Dhansekar,

您可以在CheckBox的Checked和Unchecked事件中尝试以下代码

You can try the following code in Checked and Unchecked events of CheckBox


void chkBox_Checked(object sender, RoutedEventArgs e)
{
    string content = (sender as CheckBox).Content.ToString();
}


这篇关于Silverlight CheckBox获取选定的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆