示例#1
0
文件: GuiUtils.cs 项目: Edll/iow
        /// <summary>
        /// Checks all items in the given CheckedListBox Object
        /// </summary>
        /// <param name="sender">Sender item must be off type CheckBox</param>
        /// <param name="clb">CheckedListBox wich will be checked</param>
        public static void CheckboxListSetAllItems(object sender, CheckedListBox clb)
        {
            if (!(sender is CheckBox))
            {
                return;
            }

            var cb = (CheckBox)sender;

            if (cb.Checked)
            {
                for (var i = 0; i < clb.Items.Count; i++)
                {
                    CheckBoxListSetChecked(clb, i, true);
                }
            }
            else
            {
                for (var i = 0; i < clb.Items.Count; i++)
                {
                    clb.SetSelected(i, true);
                    CheckBoxListSetChecked(clb, i, false);
                    clb.SetSelected(i, false);
                }
            }
        }
示例#2
0
        private void MoveListRow(int offset, CheckedListBox lb)
        {
            if (lb.SelectedIndex < 0)
            {
                return;
            }
            int idx = lb.SelectedIndex;

            if ((offset == -1 && idx == 0) || (offset == 1 && idx == lb.Items.Count - 1))
            {
                return;
            }

            string s  = lb.Items[idx].ToString();
            bool   ch = false;

            ch = lb.GetItemChecked(idx);
            lb.Items.RemoveAt(idx);
            lb.Items.Insert(idx + offset, s);
            lb.SetItemChecked(idx + offset, ch);
            lb.Refresh();
            lb.SetSelected(idx, false);
            lb.Focus();
            lb.SetSelected(idx + offset, true);
        }
示例#3
0
        private void SetCheckListBoxSelected(CheckedListBox chkListBox)
        {
            int iSelectedIndex = -1;

            if (!chkListBox.CheckOnClick)
            {
                iSelectedIndex = chkListBox.SelectedIndex;
                if (chkListBox.GetSelected(iSelectedIndex))
                {
                    if (chkListBox.Items[iSelectedIndex].ToString() == Definition.VARIABLE.STAR)
                    {
                        for (int i = 1; i < chkListBox.Items.Count; i++)
                        {
                            chkListBox.SetItemChecked(i, false);
                        }
                    }
                    else
                    {
                        chkListBox.SetItemChecked(0, false);
                    }

                    chkListBox.SetSelected(iSelectedIndex, true);
                }
            }
            else
            {
                chkListBox.SetSelected(chkListBox.SelectedIndex, false);
            }
        }
 private void SearchEcode(string searchString, CheckedListBox cbEcodes)
 {
     if (searchString.Trim().Length > 0)
     {
         for (int i = 0; i < cbEcodes.Items.Count; i++)
         {
             if (cbEcodes.Items[i].ToString() == "System.Data.DataRowView")  // for listbox search
             {
                 if (((System.Data.DataRowView)(cbEcodes.Items[i])).Row.ItemArray[1].ToString().IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0)
                 {
                     cbEcodes.SetSelected(i, true);
                     break;
                 }
                 else
                 {
                     cbEcodes.SetSelected(i, false);
                 }
             }
             else  // for checkbox list search
             {
                 if (cbEcodes.Items[i].ToString().IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0)
                 {
                     cbEcodes.SetSelected(i, true);
                     break;
                 }
                 else
                 {
                     cbEcodes.SetSelected(i, false);
                 }
             }
         }
     }
 }
示例#5
0
        void MoveItem(CheckedListBox list, int direction)
        {
            // Checking selected item
            if (list.SelectedItem == null || list.SelectedIndex < 0)
            {
                return; // No selected item - nothing to do
            }
            // Calculate new index using move direction
            int newIndex = list.SelectedIndex + direction;

            // Checking bounds of the range
            if (newIndex < 0 || newIndex >= list.Items.Count)
            {
                return; // Index out of range - nothing to do
            }
            object selected   = list.SelectedItem;
            bool   checkedBox = list.GetItemChecked(list.SelectedIndex);

            // Removing removable element
            list.Items.Remove(selected);
            // Insert it in new position
            list.Items.Insert(newIndex, selected);
            // Restore selection
            list.SetSelected(newIndex, true);
            //Restored Checkbox
            list.SetItemChecked(newIndex, checkedBox);
        }
示例#6
0
        /**
         * Fill data to check list box
         * Example: dataProvider.CHECKED_LIST_BOX("select username from [User]", checkListBoxUser);
         */

        public void CHECKED_LIST_BOX(string query, CheckedListBox checkListBox)
        {
            SqlConnection con = null;
            SqlCommand    cmd = null;
            SqlDataReader dr  = null;

            try
            {
                con = new SqlConnection(connStr);
                con.Open();
                if (checkListBox.Items.Count > 0)
                {
                    checkListBox.Items.Clear();
                }
                cmd = new SqlCommand(query, con);
                dr  = cmd.ExecuteReader();
                while (dr.Read())
                {
                    checkListBox.Items.Add(dr[0].ToString());
                }
                checkListBox.SetSelected(0, true);
                checkListBox.SetItemChecked(0, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dr.Close();
                con.Close();
            }
        }
示例#7
0
 public static void limpiarCheckboxList(CheckedListBox cbl)
 {
     foreach (int i in cbl.CheckedIndices)
     {
         cbl.SetItemCheckState(i, CheckState.Unchecked);
         cbl.SetSelected(i, false);
     }
 }
示例#8
0
 private void CheckedChanged(CheckedListBox clb, bool check)
 {
     for (int i = 0; i < clb.Items.Count; i++)
     {
         clb.SetItemChecked(i, check);
     }
     clb.Refresh();
     clb.Focus();
     if (clb.SelectedIndex >= 0)
     {
         clb.SetSelected(clb.SelectedIndex, true);
     }
     else if (clb.Items.Count > 0)
     {
         clb.SetSelected(0, true);
     }
 }
示例#9
0
        public static void ClearSelection(CheckedListBox listBox)
        {
            var ind = listBox.SelectedIndices;

            foreach (var item in ind)
            {
                listBox.SetSelected((int)item, false);
            }
        }
示例#10
0
        private void Search_tx_TextChanged(object sender, EventArgs e)
        {
            string searchString = Search_tx.Text;

            int index = itemlistbox.FindString(searchString, -1);

            if (index != -1)
            {
                itemlistbox.SetSelected(index, true);
            }
        }
示例#11
0
 private void SelectPair(CheckedListBox lb, CheckedListBox lb2, bool select = true, bool justSelected = false)
 {
     if (!lb.Focused)
     {
         return;
     }
     lb2.ClearSelected();
     if (lb.SelectedIndices.Count > 0 && (lb.GetItemChecked(lb.SelectedIndex) || justSelected))
     {
         int i = lb.CheckedIndices.OfType <int>().Count(x => x < lb.SelectedIndex);
         if (i < lb2.CheckedItems.Count)
         {
             lb2.SetSelected(lb2.CheckedIndices[i], select);
         }
     }
 }
示例#12
0
 static public void diminueSelection(CheckedListBox tab)
 {
     if (tab.SelectedIndex.ToString() != "-1")
     {
         if (tab.SelectedIndex < tab.Items.Count - 1)
         {
             bool   etatItem = tab.GetItemChecked(tab.SelectedIndex);
             string valeur   = tab.SelectedItem.ToString();
             int    index    = tab.SelectedIndex;
             tab.Items.RemoveAt(index);
             tab.Items.Insert(index + 1, valeur);
             tab.SetItemChecked(index + 1, etatItem);
             tab.SetSelected(index + 1, true);
         }
     }
 }
示例#13
0
        void control_Click(object sender, EventArgs e)
        {
            Control        control = sender as Control;
            Control        selectionSourceControl = buttonDict[control];
            SelectionTypes selectType             = functionDict[control];

            if (selectionSourceControl is CheckedListBox)
            {
                CheckedListBox checkedListBox = selectionSourceControl as CheckedListBox;
                for (int i = 0; i < checkedListBox.Items.Count; i++)
                {
                    bool _selected = checkedListBox.GetItemChecked(i);
                    _selected = ChangSelected(_selected, selectType);
                    checkedListBox.SetItemChecked(i, _selected);
                    checkedListBox.SetSelected(i, _selected);
                }
            }
        }
示例#14
0
        private void FilterListItem(CheckedListBox clb, string filter)
        {
            if (string.IsNullOrEmpty(filter))
            {
                return;
            }
            ListItem li;

            for (int i = 0; i < clb.Items.Count; i++)
            {
                li = clb.Items[i] as ListItem;
                if (li.Value.StartsWith(filter, StringComparison.CurrentCultureIgnoreCase))
                {
                    clb.SetSelected(i, true);
                    break;
                }
            }
        }
示例#15
0
 static public void augmenteSelection(CheckedListBox tab)
 {
     if (tab.SelectedIndex.ToString() != "-1")
     {
         string valeur;
         int    index;
         bool   etatItem = tab.GetItemChecked(tab.SelectedIndex);
         if (tab.SelectedIndex > 0)
         {
             valeur = tab.SelectedItem.ToString();
             index  = tab.SelectedIndex;
             tab.Items.RemoveAt(index);
             tab.Items.Insert(index - 1, valeur);
             tab.SetItemChecked(index - 1, etatItem);
             tab.SetSelected(index - 1, true);
         }
     }
 }
示例#16
0
        private void ButtonFindExact_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TextBoxFindSelect.Text))
            {
                MessageBox.Show("Nothing to searching.", "No data", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            int iTemp = CheckedListBox.FindString(TextBoxFindSelect.Text, CheckedListBox.SelectedIndex);

            if (iTemp != -1)
            {
                // CheckedListBox.SetItemCheckState(iTemp, CheckState.Checked)
                CheckedListBox.SetSelected(iTemp, true);
            }
            else
            {
                MessageBox.Show("Nothing founded.", "Nothing", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void cmbPredmeti_SelectedIndexChanged(object sender, EventArgs e)
        {
            Studenti student = (Studenti)cmbStudenti.SelectedItem;

            //Brisanje predmeta sa drugog smera da bi ubacio drugi
            for (int i = 0; i < svi_predmeti_studenta.Items.Count; i++)
            {
                Predmet p = Predmet.vretiPredmetPoNazivu(svi_predmeti_studenta.Items[i].ToString());

                if (p != null)
                {
                    if (!p.Smer.ToString().Equals(student.Smer.ToString()))
                    {
                        svi_predmeti_studenta.Items.RemoveAt(i);
                        cmbPredmeti.Items.Add(p);
                    }
                }
            }

            //Ubacivanje novog predmeta
            Predmet predmet = (Predmet)cmbPredmeti.SelectedItem;

            svi_predmeti_studenta.Items.Add(predmet.Naziv_predmeta + ",  " + predmet.Smer + ",  " + predmet.Semestar, true);
            svi_predmeti_studenta.SetSelected(svi_predmeti_studenta.Items.Count - 1, true);
            cmbPredmeti.Items.Remove(predmet);

            //Trenutni ESPB bodovi
            broj = 0;
            for (int i = 0; i < svi_predmeti_studenta.Items.Count; i++)
            {
                if (svi_predmeti_studenta.GetItemCheckState(i) == CheckState.Checked || svi_predmeti_studenta.GetItemCheckState(i) == CheckState.Indeterminate)
                {
                    broj += 6;
                }
            }
            lblESPB.Text = "ESPB: " + broj;
        }
示例#18
0
    public MainDialog()
    {
        leftPadCol1 = 11;
        leftPadCol2 = 181;
        leftPadCol3 = 311;

        Text="Mouse";
        StartPosition = FormStartPosition.Manual;
        Location = new Point(100, 100);
        Size = new Size(600, 400);

        Closed += new EventHandler(MainDialog_Closed);

        //left column
        m_LB = new ListBox();
        m_LB.Items.Clear();
        m_LB.IntegralHeight = false;
        m_LB.Location = new Point(leftPadCol1, 10);
        m_LB.Size = new Size(160, 190);
        m_LB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"});
        m_LB.SelectionMode = SelectionMode.One;
        m_LB.SetSelected(1, true);
        m_LB.SelectedIndexChanged += new EventHandler(LB_SelIndChanged);
        Controls.Add(m_LB);

        m_B_Create = new Button();
        m_B_Create.Text = "Create";
        m_B_Create.Location = new Point(5, 20);
        m_B_Create.Size = new Size(100, 24);
        m_B_Create.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
        m_B_Create.Click += new System.EventHandler(B_C_Create);
        m_B_Create.BackColor = Color.Green;
        Controls.Add(m_B_Create);

        m_B_Edit = new Button();
        m_B_Edit.Text = "Edit";
        m_B_Edit.Location = new Point(5, 50);
        m_B_Edit.Size = new Size(100, 24);
        m_B_Edit.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
        m_B_Edit.Click += new System.EventHandler(B_C_Edit);
        m_B_Edit.BackColor = Color.Blue;
        Controls.Add(m_B_Edit);

        m_B_Delete = new Button();
        m_B_Delete.Text = "Delete";
        m_B_Delete.Location = new Point(5, 80);
        m_B_Delete.Size = new Size(100, 24);
        m_B_Delete.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
        m_B_Delete.Click += new System.EventHandler(B_C_Delete);
        m_B_Delete.BackColor = Color.Red;
        Controls.Add(m_B_Delete);

        m_GB_Button = new GroupBox();
        m_GB_Button.Text = "Edit list";
        m_GB_Button.Location = new Point(leftPadCol1, 211);
        m_GB_Button.Size = new Size(110, 110);
        m_GB_Button.Controls.AddRange(new Control[] {m_B_Create, m_B_Edit, m_B_Delete});
        Controls.Add(m_GB_Button);

        //middle column
        m_LabelName = new Label();
        m_LabelName.Text = "Name";
        m_LabelName.Name = "LabelName";
        m_LabelName.Location = new Point(leftPadCol2, 10);
        m_LabelName.Size = new Size(120, 16);
        m_LabelName.TextAlign = ContentAlignment.MiddleLeft;
        m_LabelName.Font = new Font("Arial", 10F, FontStyle.Italic | FontStyle.Bold);
        m_LabelName.ForeColor = Color.FromArgb(0, 0, 0);
        Controls.Add(m_LabelName);

        m_LabelColor = new Label();
        m_LabelColor.Text = "Color";
        m_LabelColor.Name = "LabelColor";
        m_LabelColor.Location = new Point(leftPadCol2, 40);
        m_LabelColor.Size = new Size(120, 16);
        m_LabelColor.TextAlign = ContentAlignment.MiddleLeft;
        m_LabelColor.Font = new Font("Arial", 10F, FontStyle.Italic | FontStyle.Bold);
        m_LabelColor.ForeColor = Color.FromArgb(0, 0, 0);
        Controls.Add(m_LabelColor);

        m_LabelSite = new Label();
        m_LabelSite.Text = "Web Site";
        m_LabelSite.Name = "LabelSite";
        m_LabelSite.Location = new Point(leftPadCol2, 130);
        m_LabelSite.Size = new Size(120, 16);
        m_LabelSite.TextAlign = ContentAlignment.MiddleLeft;
        m_LabelSite.Font = new Font("Arial", 10F, FontStyle.Italic | FontStyle.Bold);
        m_LabelSite.ForeColor = Color.FromArgb(0, 0, 0);
        Controls.Add(m_LabelSite);

        //right column
        m_TBName = new TextBox();
        m_TBName.Text = "";
        m_TBName.Location = new Point(leftPadCol3, 10);
        m_TBName.Size = new Size(120, 16);
        m_TBName.Multiline = false;
        m_TBName.MaxLength = 1000;
        m_TBName.ScrollBars = ScrollBars.Both;
        m_TBName.WordWrap = false;
        m_TBName.TextChanged += new EventHandler(TB_TextChanged);
        Controls.Add(m_TBName);

        m_RB_Red = new RadioButton();
        m_RB_Red.Text = "Red";
        m_RB_Red.Checked = false;
        m_RB_Red.Location = new Point(16, 16);
        m_RB_Red.Size = new Size(80, 20);
        m_RB_Red.Click += new System.EventHandler(RB_Click);
        m_RB_Red.Click += new System.EventHandler(RB_Click_Mes);

        m_RB_Green = new RadioButton();
        m_RB_Green.Text = "Green";
        m_RB_Green.Checked = true;
        m_RB_Green.Location = new Point(16, 36);
        m_RB_Green.Size = new Size(80, 20);
        m_RB_Green.Click += new System.EventHandler(RB_Click);

        m_RB_Blue = new RadioButton();
        m_RB_Blue.Text = "Blue";
        m_RB_Blue.Checked = false;
        m_RB_Blue.Location = new Point(16, 56);
        m_RB_Blue.Size = new Size(80, 20);
        m_RB_Blue.Click += new System.EventHandler(RB_Click);

        m_GB_Color = new GroupBox();
        m_GB_Color.Text = "Choose color";
        m_GB_Color.Location = new Point(leftPadCol3, 40);
        m_GB_Color.Size = new Size(120, 80);
        m_GB_Color.Controls.AddRange(new Control[] {m_RB_Red, m_RB_Green, m_RB_Blue});
        Controls.Add(m_GB_Color);

        m_LLabel = new LinkLabel();
        m_LLabel.Name = "Label2";
        m_LLabel.Text = "www.logitec.com";
        //m_LLabel.Text = "text.txt";
        m_LLabel.Location = new Point(leftPadCol3, 130);
        m_LLabel.Size = new Size(120, 16);
        m_LLabel.TextAlign = ContentAlignment.MiddleLeft;
        m_LLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(L2_LClicked);
        Controls.Add(m_LLabel);

        m_TT = new ToolTip();
        m_TT.AutomaticDelay = 300;
        m_TT.ShowAlways = true;
        m_TT.SetToolTip(m_B_Create, "pressing the button will display message box");

        m_CLB = new CheckedListBox();
        m_CLB.Items.Clear();
        m_CLB.IntegralHeight = false;
        m_CLB.Location = new Point(310, 310);
        m_CLB.Size = new Size(160, 90);
        m_CLB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"});
        m_CLB.SelectionMode = SelectionMode.One;
        m_CLB.SetSelected(1, true);
        m_CLB.CheckOnClick = true;
        m_CLB.SelectedIndexChanged += new EventHandler(CLB_SelIndChanged);
        Controls.Add(m_CLB);

        // Создаем экземпляр класса
        XmlDocument xmlDoc = new XmlDocument();
        // Загружаем XML-документ из файла
        xmlDoc.Load("db.xml");
        // Загружаем XML-документ из строки
        // xmlDoc.LoadXML(s1);

        // Получаем всех детей корневого элемента
        // xmlDoc.DocumentElement - корневой элемент
        foreach (XmlNode table in xmlDoc.DocumentElement.ChildNodes)
        {
            // перебираем все атрибуты элемента
            foreach (XmlAttribute attr in table.Attributes)
            {
                // attr.Name - имя текущего атрибута
                // attr.Value - значение текущего атрибута
                m_LB.Items.Add(attr.Name + ":" + attr.Value);
            }

            // перебираем всех детей текущего узла
            foreach (XmlNode ch in table.ChildNodes)
            {

            }
            // Получаем текст хранящийся в текущем узле
            //MessageBox.Show(s);
        }
    }
        private static void SetControlProperties(Control currentCtrl, XmlNode n)
        {
            string controlName = n.Attributes["Name"].Value;

            if (controlName == "Extra")
            {
                ScriptFarmDNC.idleX = float.Parse(n["idleX"].InnerText);
                ScriptFarmDNC.idleY = float.Parse(n["idleY"].InnerText);
                ScriptFarmDNC.idleZ = float.Parse(n["idleZ"].InnerText);
            }
            if (controlName == "")
            {
                return;
            }
            string controlType = n.Attributes["Type"].Value;

            if (controlType == "")
            {
                return;
            }
            Control[] ctrl = currentCtrl.Controls.Find(controlName, true);
            if (ctrl.Length > 0)
            {
                Control ctrlToSet = GetImmediateChildControl(ctrl, currentCtrl);
                if (ctrlToSet != null)
                {
                    if (ctrlToSet.GetType().ToString() == controlType)
                    {
                        switch (controlType)
                        {
                        case "Extra":
                            break;

                        case "System.Windows.Forms.CheckedListBox":
                            CheckedListBox ltr    = (CheckedListBox)ctrlToSet;
                            var            Icount = Convert.ToInt32(n["SelectedIndexcount"].InnerText);
                            foreach (int i in ltr.CheckedIndices)
                            {
                                ltr.SetItemCheckState(i, CheckState.Unchecked);
                            }
                            for (int i = 0; i < (Icount); i++)
                            {
                                var sitem = n["SelectedItem" + i.ToString()].InnerText;
                                if (sitem != null && ltr.Items.Contains(sitem))
                                {
                                    var index = ltr.Items.IndexOf(sitem);
                                    ltr.SetItemCheckState(index, CheckState.Checked);
                                    ltr.SetSelected(index, true);
                                }
                            }
                            break;

                        case "System.Windows.Forms.RadioButton":
                            ((RadioButton)ctrlToSet).Checked = Convert.ToBoolean(n["Checked"].InnerText);
                            break;

                        case "System.Windows.Forms.GroupBox":
                            ((GroupBox)ctrlToSet).Enabled = Convert.ToBoolean(n["Enabled"].InnerText);
                            break;

                        case "System.Windows.Forms.NumericUpDown":
                            ((NumericUpDown)ctrlToSet).Value   = Convert.ToDecimal(n["Value"].InnerText);
                            ((NumericUpDown)ctrlToSet).Enabled = Convert.ToBoolean(n["Enabled"].InnerText);
                            break;

                        case "System.Windows.Forms.TextBox":
                            ((TextBox)ctrlToSet).Text = n["Text"].InnerText;
                            break;

                        case "System.Windows.Forms.ComboBox":
                            if (((ComboBox)ctrlToSet).Text == "Not Selected")
                            {
                                ((ComboBox)ctrlToSet).Text = n["Text"].InnerText;
                            }
                            else
                            {
                                ((ComboBox)ctrlToSet).Text = "";
                            }

                            ((ComboBox)ctrlToSet).SelectedText = n["Text"].InnerText;
                            break;

                        case "System.Windows.Forms.CheckBox":
                            ((CheckBox)ctrlToSet).Checked    = Convert.ToBoolean(n["Checked"].InnerText);
                            ((CheckBox)ctrlToSet).CheckState = (CheckState)Enum.Parse(typeof(CheckState), n["CheckState"].InnerText);
                            break;
                        }
                        if (n.HasChildNodes && ctrlToSet.HasChildren)
                        {
                            XmlNodeList xnlControls = n.SelectNodes("Control");
                            foreach (XmlNode n2 in xnlControls)
                            {
                                SetControlProperties(ctrlToSet, n2);
                            }
                        }
                    }
                }
            }
        }
示例#20
0
文件: GuiUtils.cs 项目: Edll/iow
 private static void CheckBoxListSetChecked(CheckedListBox clb, int i, bool check)
 {
     clb.SetSelected(i, true);
     clb.SetItemChecked(i, check);
     clb.SetSelected(i, false);
 }
示例#21
0
    public MainDialog()
    {
        Text="Dialog based application";
        StartPosition = FormStartPosition.Manual;
        Location = new Point(100, 100);
        Size = new Size(700, 400);

        Closed += new EventHandler(MainDialog_Closed);

        m_Label = new Label();
        m_Label.Text = ".Net Framevork";
        m_Label.Name = "Label1";
        m_Label.Location = new Point(16, 16);
        m_Label.Size = new Size(120, 16);
        m_Label.TextAlign = ContentAlignment.MiddleCenter;
        m_Label.Font = new Font("Arial", 10F, FontStyle.Italic | FontStyle.Bold);
        m_Label.ForeColor = Color.FromArgb(255, 0, 0);
        Controls.Add(m_Label);

        m_LLabel = new LinkLabel();
        m_LLabel.Name = "Label2";
        //m_LLabel.Text = "www.microsoft.com";
        m_LLabel.Text = "text.txt";
        m_LLabel.Location = new Point(16, 40);
        m_LLabel.Size = new Size(120, 16);
        m_LLabel.TextAlign = ContentAlignment.MiddleCenter;
        m_LLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(L2_LClicked);
        Controls.Add(m_LLabel);

        m_B = new Button();
        m_B.Text = "Push me";
        m_B.Location = new Point(18, 70);
        m_B.Size = new Size(100, 24);
        m_B.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
        m_B.Click += new System.EventHandler(B_C);
        Controls.Add(m_B);

        m_TB = new TextBox();
        m_TB.Text = "";
        m_TB.Location = new Point(140, 16);
        m_TB.Size = new Size(160, 190);
        m_TB.Multiline = true;
        m_TB.MaxLength = 1000;
        m_TB.ScrollBars = ScrollBars.Both;
        m_TB.WordWrap = false;
        m_TB.TextChanged += new EventHandler(TB_TextChanged);
        Controls.Add(m_TB);

        m_RB_Red = new RadioButton();
        m_RB_Red.Text = "Red";
        m_RB_Red.Checked = false;
        m_RB_Red.Location = new Point(16, 16);
        m_RB_Red.Size = new Size(80, 20);
        m_RB_Red.Click += new System.EventHandler(RB_Click);
        m_RB_Red.Click += new System.EventHandler(RB_Click_Mes);

        m_RB_Green = new RadioButton();
        m_RB_Green.Text = "Green";
        m_RB_Green.Checked = true;
        m_RB_Green.Location = new Point(16, 36);
        m_RB_Green.Size = new Size(80, 20);
        m_RB_Green.Click += new System.EventHandler(RB_Click);

        m_RB_Blue = new RadioButton();
        m_RB_Blue.Text = "Blue";
        m_RB_Blue.Checked = false;
        m_RB_Blue.Location = new Point(16, 56);
        m_RB_Blue.Size = new Size(80, 20);
        m_RB_Blue.Click += new System.EventHandler(RB_Click);

        m_B.BackColor = Color.Green;

        m_GB_Color = new GroupBox();
        m_GB_Color.Text = "Choose color";
        m_GB_Color.Location = new Point(18, 100);
        m_GB_Color.Size = new Size(100, 80);
        m_GB_Color.Controls.AddRange(new Control[] {m_RB_Red, m_RB_Green, m_RB_Blue});
        Controls.Add(m_GB_Color);

        m_TT = new ToolTip();
        m_TT.AutomaticDelay = 300;
        m_TT.ShowAlways = true;
        m_TT.SetToolTip(m_B, "pressing the button will display message box");

        m_LB = new ListBox();
        m_LB.Items.Clear();
        m_LB.IntegralHeight = false;
        m_LB.Location = new Point(310, 16);
        m_LB.Size = new Size(160, 90);
        m_LB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"});
        m_LB.SelectionMode = SelectionMode.MultiSimple;
        m_LB.SetSelected(1, true);
        m_LB.SelectedIndexChanged += new EventHandler(LB_SelIndChanged);
        Controls.Add(m_LB);

        m_CLB = new CheckedListBox();
        m_CLB.Items.Clear();
        m_CLB.IntegralHeight = false;
        m_CLB.Location = new Point(310, 110);
        m_CLB.Size = new Size(160, 90);
        m_CLB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"});
        m_CLB.SelectionMode = SelectionMode.One;
        m_CLB.SetSelected(1, true);
        m_CLB.CheckOnClick = true;
        m_CLB.SelectedIndexChanged += new EventHandler(CLB_SelIndChanged);
        Controls.Add(m_CLB);

        m_CB = new ComboBox();
        m_CB.Items.Clear();
        m_CB.Location = new Point(480, 16);
        m_CB.Size = new Size(160, 20);
        m_CB.DropDownStyle = ComboBoxStyle.DropDownList;
        m_CB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"});
        m_CB.SelectedIndex = 0;
        m_CB.SelectedIndexChanged += new EventHandler(CB_TextChanged);
        Controls.Add(m_CB);

        m_DUD = new DomainUpDown();
        m_DUD.Items.Clear();
        m_DUD.Location = new Point(480, 46);
        m_DUD.Size = new Size(160, 20);
        m_DUD.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"});
        m_DUD.ReadOnly = true;
        m_DUD.UpDownAlign = LeftRightAlignment.Left;
        m_DUD.TextAlign = HorizontalAlignment.Right;
        m_DUD.Wrap = true;
        m_DUD.SelectedIndex = 1;
        Controls.Add(m_DUD);

        m_NUD = new NumericUpDown();
        m_NUD.Location = new Point(480, 76);
        m_NUD.Size = new Size(160, 20);
        m_NUD.Minimum = new Decimal(-10);
        m_NUD.Maximum = new Decimal(10);
        m_NUD.Increment = new Decimal(0.1);
        m_NUD.DecimalPlaces = 1;
        m_NUD.Value = new Decimal(0.0);
        m_NUD.ValueChanged += new EventHandler(NUD_ValueChanged);
        Controls.Add(m_NUD);

        m_CT_L = new Label();
        m_CT_L.Text = "";
        m_CT_L.Location = new Point(18, 220);
        m_CT_L.Size = new Size(100, 16);
        m_CT_L.BorderStyle = BorderStyle.Fixed3D;
        m_CT_L.TextAlign = ContentAlignment.MiddleCenter;
        Controls.Add(m_CT_L);

        m_STT_B = new Button();
        m_STT_B.Text = "Start timer";
        m_STT_B.Location = new Point(18, 246);
        m_STT_B.Size = new Size(100, 24);
        m_STT_B.Click += new EventHandler(STT_BC);
        Controls.Add(m_STT_B);

        m_SPT_B = new Button();
        m_SPT_B.Text = "Stop timer";
        m_SPT_B.Location = new Point(18, 280);
        m_SPT_B.Size = new Size(100, 24);
        m_SPT_B.Click += new EventHandler(STP_BC);
        Controls.Add(m_SPT_B);

        m_T = new Timer();
        m_T.Enabled = true;
        m_T.Interval = 100;
        m_T.Stop();
        m_T.Tick += new EventHandler(T_T);

        m_LL = new Label();
        m_LL.Location = new Point(480, 116);
        m_LL.Size = new Size(160, 20);
        m_LL.TextAlign = ContentAlignment.MiddleCenter;
        Controls.Add(m_LL);

        m_TrB = new TrackBar();
        m_TrB.Minimum = 0;
        m_TrB.Maximum = 100;
        m_TrB.Value = 50;
        m_LL.Text = "Nivelul indicatorul  este " + m_TrB.Value;
        m_TrB.Location = new Point(480, 146);
        m_TrB.Size = new Size(160, 20);
        m_TrB.Orientation = Orientation.Horizontal;
        m_TrB.TickStyle = TickStyle.TopLeft;
        m_TrB.TickFrequency = 10;
        m_TrB.Scroll += new EventHandler(TrB_Scroll);
        Controls.Add(m_TrB);
    }