Re: CheckBox in SilverLight
What you want to retrieve the state of your checkbox?
- In an event handler? it would be the rather something like
Code:
if ((sender as checkbox). IsChecked == true)
-Or in a function called as needed and which scans the status of components on your page?
in this case I still want to spend
Code:
this.children [i]. Name = "Chekbox" + system.convert.tostring (i)
and i varies between 0 and the number of accurately on your page this.children.count but not very optimized EST! syntax this.control I do not know
Whether you are looking to do exactly?
Re: CheckBox in SilverLight
Infact the checkbox are the days of the week and depending on whether the checkbox is checked or not, there posters. This after the click on the refresh button. So, if you have any other idea other that this then please let me know. Thanks for your replies.
Re: CheckBox in SilverLight
It is not this.Controls but Panle.Children. Otherwise you can use the Binding it's so much easier. You created a class with 2 Day Property Name and Enabled and then you bind the Enabled on the Check of your CheckBox. When you want to know what is checked you walk your <Day> List and you look at the values Enabled.
Re: CheckBox in SilverLight
Yes the problem is the bin, it do not already long since I start with c # winforms. But I find nothing in silverlight, I have had trouble making a drag and drop. You think it's the easiest Binding? For me, this I thought I could do my small loop.
Code:
for (x = 1; x <= 7; x + +) (if ((CheckBox) grid3.Children ["CheckBox" + x]. IsChecked == true) (/ / code))
Re: CheckBox in SilverLight
Check out the following code, this will help you
Code:
public static class Week
(
public static IEnumerable <dy> Days
(
gt
(
return new dy[]
(
new dy("Monday"),
new dy("Tuesday"),
new dy("Wednesday"),
new dy("Thursday "),
new dy("Friday"),
new dy("Saturday"),
new dy("Sunday")
);
)
)
)
public class dy
(
public string nm ( gt; st; )
public bool IsEnabled ( gt; st; )
public dy(String nm)
(
nm = nm;
)
)
Re: CheckBox in SilverLight
Infact the goal is to achieve a kind of outlook calendar for cons I failed to make the component. So, I made a grid with 7 rows and 12 columns, and there are 7 column 0 label on the grid for days, and 12 up for hours. Except that now the thing must be dynamic so if I check off Monday, Tuesday, Wednesday, Thursday, Friday and I click on "Refresh" eh bin label should disappear on Saturday and Sunday. I set for Monday label1, label2 Tuesday similar for the checkbox.