Exemple #1
0
        private void btn_edit_Click(object sender, RoutedEventArgs e)
        {
            int idx = lb_P.SelectedIndex;

            if (idx < 0)
            {
                return;
            }

            PEditor pEditor = new PEditor();

            pEditor.txt_P.Text = lb_P.SelectedItem.ToString();

            if (pEditor.ShowDialog() == true)
            {
                string result = pEditor.getResult();

                if (result.Trim().Length <= 0)
                {
                    return;
                }

                lb_P.Items[idx] = result;
            }
        }
Exemple #2
0
        private void btn_add_Click(object sender, RoutedEventArgs e)
        {
            PEditor pEditor = new PEditor();

            pEditor.txt_P.Text = "123";
            if (pEditor.ShowDialog() == true)
            {
                string result = pEditor.getResult();

                if (result.Trim().Length <= 0)
                {
                    return;
                }

                lb_P.Items.Add(result);
            }
        }