private Control AddToPanel(TargetWordElement targetWordElement)
        {
            var textBox = new TextBoxWithButtons(this)
            {
                TargetWordElement = targetWordElement,
                Font        = TargetWordFont,
                RightToLeft = TargetWordRightToLeft
            };

            flowLayoutPanelTargetWords.Controls.Add(textBox);
            return(textBox);
        }
        public void MoveUpTextWithButtons(TextBoxWithButtons textBoxWithButtons)
        {
            int nIndex = flowLayoutPanelTargetWords.Controls.IndexOf(textBoxWithButtons);

            if (nIndex <= 0)
            {
                return;
            }

            int nNewIndex = nIndex - 1;

            SourceWordElement.ReorderTargetForms(nIndex, nNewIndex);
            flowLayoutPanelTargetWords.Controls.SetChildIndex(textBoxWithButtons, nNewIndex);
            CallToSetModified();
        }
        public void DeleteTextWithButtons(TextBoxWithButtons textBoxWithButtons)
        {
            flowLayoutPanelTargetWords.Controls.Remove(textBoxWithButtons);
            SourceWordElement.Remove(textBoxWithButtons.TargetWordElement.TargetWord);

            if (flowLayoutPanelTargetWords.Controls.Count == 0)
            {
                DialogResult res = MessageBox.Show(String.Format(Properties.Resources.IDS_QueryToDeleteSourceWord,
                                                                 SourceWordElement.SourceWord),
                                                   EncConverters.cstrCaption, MessageBoxButtons.YesNoCancel);
                if (res == DialogResult.Yes)
                {
                    CallToDeleteSourceWord(SourceWordElement.SourceWord);
                }
            }
            CallToSetModified();
        }