예제 #1
0
        private void HV_btn_3_Click(object sender, EventArgs e)
        {
            int choice = HV_list_1.SelectedIndex;

            if (choice < 0)
            {
                MessageBox.Show("Valik puudub");
                return;
            }
            HV_list_1.Items.RemoveAt(choice);
            HV_list_1.Items.Insert(choice, HV_txt_1.Text);
            HV_list_1.SelectedIndex = -1;
            HV_txt_1.Text           = "";
            HV_txt_1.Focus();
        }
예제 #2
0
        private void HV_btn_1_Click(object sender, EventArgs e)
        {
            int choice = HV_list_1.SelectedIndex;

            if (choice < 0)
            {
                HV_list_1.Items.Add(HV_txt_1.Text);
            }
            else
            {
                HV_list_1.Items.Insert(choice, HV_txt_1.Text);
            }

            HV_list_1.SelectedIndex = -1;
            HV_txt_1.Text           = "";
            HV_txt_1.Focus();
        }