Results 1 to 7 of 7

Thread: CheckBox in SilverLight

  1. #1
    Join Date
    Sep 2009
    Posts
    177

    CheckBox in SilverLight

    Hello,
    I started in Silverlight and I try to recover the checkbox 1 to 7. I try everything and it does not work, here is the code.

    Code:
    for (x = 1; x <= 7; x + +) 
    (if ((CheckBox) this.Controls ["CheckBox" + x]. IsChecked == true) (/ / code))
    If you have an sample source code for this, then that will help me. Thank you.

  2. #2
    Join Date
    Mar 2010
    Posts
    200

    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?

  3. #3
    Join Date
    Sep 2009
    Posts
    177

    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.

  4. #4
    Join Date
    Nov 2009
    Posts
    343

    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.

  5. #5
    Join Date
    Sep 2009
    Posts
    177

    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))

  6. #6
    Join Date
    Dec 2009
    Posts
    192

    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;
        )
    )

  7. #7
    Join Date
    Jan 2010
    Posts
    70

    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.

Similar Threads

  1. Replies: 3
    Last Post: 17-04-2011, 04:25 PM
  2. Replies: 2
    Last Post: 09-08-2010, 09:11 AM
  3. Hidden Checkbox Grayed Out
    By Waman in forum Operating Systems
    Replies: 3
    Last Post: 22-10-2009, 10:51 AM
  4. Input Type Checkbox
    By raviranch in forum Software Development
    Replies: 5
    Last Post: 14-04-2009, 02:37 PM
  5. How to Build a Dynamic Checkbox ?
    By RIMON in forum Software Development
    Replies: 1
    Last Post: 28-03-2009, 11:50 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,638,249,551.00304 seconds with 17 queries