Exemplo n.º 1
0
        private void textBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (textBox1.SelectedText.Length > 0)
                {
                    var text = textBox1.SelectedText;
                    text            = ComediaHelper.TrimUnecessaryCharacters(text);
                    textBoxKey.Text = text;
                    if (_formViewTable.Visible)
                    {
                        _formViewTable.SearchKey = text;
                    }
                    if (formNoteAdd.Visible)
                    {
                        var booknum  = int.Parse(textBoxBook.Text);
                        var cantonum = int.Parse(textBoxCanto.Text);

                        var linenum = textBox1.GetLineFromCharIndex(textBox1.SelectionStart);

                        int modnum = linenum / 4;
                        var start  = int.Parse(textBoxStart.Text);
                        var pos    = start + linenum - modnum;
                        formNoteAdd.SetNoteName(text);
                        formNoteAdd.SetLocStartEnd(booknum, cantonum, pos, pos);
                        formNoteAdd.ResetNote();
                    }
                }
            }
        }