예제 #1
0
        private void lbKeywords_DoubleClick(object sender, EventArgs e)
        {
            frmInputKeyword frm = new frmInputKeyword();

            frm.Keyword = lbKeywords.SelectedItem as string;
            frm.Index   = lbKeywords.SelectedIndex;

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            lbKeywords.Items[frm.Index] = frm.Keyword;
        }
예제 #2
0
        private void btnAddKeyword_Click(object sender, EventArgs e)
        {
            frmInputKeyword frm = new frmInputKeyword();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            if (!lbKeywords.Items.Contains(frm.Keyword))
            {
                lbKeywords.Items.Add(frm.Keyword);
            }

            btnRemoveKeyword.Enabled = lbKeywords.SelectedIndex != -1;
            btnSearch.Enabled        = (txtKeyword.Text != string.Empty && radInputKeyword.Checked) || (lbKeywords.SelectedIndex != -1 && radSelectedKeywords.Checked);
        }