示例#1
0
        // drsna kontrola ve WinForms formulari :-), opet bez pouziti Linq
        public void CheckedRBLoad()
        {
            for (int s = 0; s <= 3; s++)
            {
                for (int r = 0; r <= 34; r++)
                {
                    Control ct = TableLayoutPanelSeznamPrani.GetControlFromPosition(s, r);

                    if (ct != null)
                    {
                        if (ct.GetType() == typeof(Panel))
                        {
                            Panel pa = (Panel)ct;
                            foreach (Control co in pa.Controls)
                            {
                                RadioButton f = (RadioButton)(co);
                                for (int i = 1; i <= 84; i++)
                                {
                                    string b = "radioButton" + i.ToString();
                                    foreach (string button in mojeplatno.shapes.listradiobuttonu)
                                    {
                                        if (button == b)
                                        {
                                            f.Checked = true;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
示例#2
0
        // ulozit checked RButtony
        public void CheckedRBSave()
        {
            for (int r = 6; r <= 34; r++)
            {
                Control ct = TableLayoutPanelSeznamPrani.GetControlFromPosition(1, r);

                if (ct != null)
                {
                    if (ct.GetType() == typeof(Panel))
                    {
                        Panel pa = (Panel)ct;
                        foreach (Control co in pa.Controls)
                        {
                            RadioButton f = (RadioButton)(co);
                            if (f.Checked)
                            {
                                rbuttons.Add(f.Name);
                            }
                        }
                    }
                }
            }

            mojeplatno.shapes.listradiobuttonu = rbuttons;
        }