void SetTexts(int languageID) { parentFormLabelText.Text = activeForm.GetName(); parentFormID.Text = activeForm.GetID().ToString(); ControlNameLabel.Text = activeFormControl.GetName(); formControlID.Text = activeFormControl.GetID().ToString(); OriginalTextLabel.Text = activeFormControl.GetOriginalText(); ControlTypeLabel.Text = activeFormControl.GetType(); TranslationInput.Text = TranslationAvailable(activeFormControl.GetID(), languageID) ? translationList.GetTranslation(activeFormControl.FormControl, languageList.GetLanguage(languageID)).TranslatedText : ""; if (activeFormControl.GetOriginalText() != null && activeFormControl.GetOriginalText().Length > 0) { Clipboard.SetText(OriginalTextLabel.Text); } else { return; } }
private void Activate_MenuItems(Form ActiveForm) { CurrentActiveForm = ActiveForm; bool blnButtonFound = false; Control mylblHeaderControl = CurrentActiveForm.Controls["lblHeader"]; if (mylblHeaderControl != null) { mylblHeaderControl.ForeColor = Color.Black; } Control mybtnHeaderCloseControl = CurrentActiveForm.Controls["btnHeaderClose"]; if (mybtnHeaderCloseControl != null) { mybtnHeaderCloseControl.ForeColor = Color.Black; } Control mybtnHeaderMinimizeControl = CurrentActiveForm.Controls["btnHeaderMinimize"]; if (mybtnHeaderMinimizeControl != null) { mybtnHeaderMinimizeControl.ForeColor = Color.Black; } foreach (ToolStripItem tsItem in this.toolMainStrip.Items) { if (tsItem.Text == "New" | tsItem.Text == "Update" | tsItem.Text == "Delete" | tsItem.Text == "Save" | tsItem.Text == "Cancel") { blnButtonFound = false; //Find If Button Exist is Form foreach (Control ActiveFormControl in ActiveForm.Controls) { if (ActiveFormControl.GetType().ToString() == "System.Windows.Forms.Button") { if (ActiveFormControl.Text.Replace("&", "") == tsItem.Text) { blnButtonFound = true; tsItem.Enabled = ActiveFormControl.Enabled; //Hook Up Enable / Disable Event ActiveFormControl.EnabledChanged += new System.EventHandler(Button_EnabledChanged); for (int intCount = 0; intCount < editToolStripMenuItem.DropDownItems.Count; intCount++) { if (editToolStripMenuItem.DropDownItems[intCount].Text == ActiveFormControl.Text.Replace("&", "")) { editToolStripMenuItem.DropDownItems[intCount].Enabled = ActiveFormControl.Enabled; break; } } break; } } } if (blnButtonFound == false) { tsItem.Enabled = false; } } } }