Example #1
0
        private void TC_ProgramingLanguages_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (TC_ProgramingLanguages.SelectedIndex != -1)
            {
                if (TC_ProgramingLanguages.SelectedTab.Name != "NewProgramingLanguageForm")
                {
                    TabPage tabPage = TC_ProgramingLanguages.SelectedTab;
                    tabPage.Controls.Add(this.LB_CodeName);
                    tabPage.Controls.Add(this.TXTBOX_Code);
                    tabPage.Controls.Add(this.TXTBOX_CodeDescription);
                    BTN_DeleteProgramingLanguage.Show();
                    BTN_DeleteCode.Show();
                    BTN_DeleteCode.Enabled         = false;
                    TXTBOX_Code.Enabled            = false;
                    TXTBOX_CodeDescription.Enabled = false;

                    LoadCodeSnippetList(-1);
                    GB_AboutSoftware.Size = new Size(149, 219);
                }
                else
                {
                    BTN_DeleteProgramingLanguage.Hide();
                    BTN_DeleteCode.Hide();
                }
                BTN_SaveChanges.Hide();
                BTN_DropChanges.Hide();
                LB_CodeName.Enabled = true;
            }
        }
Example #2
0
        private void BTN_AddProgramingLanguage_Click(object sender, EventArgs e)
        {
            SQLCommand("INSERT INTO ProgramingLanguages (name) VALUES('" + TXTBOX_ProgramingLanguageName.Text + "')");
            LoadProgramingLanguagesList(TC_ProgramingLanguages.TabPages.Count - 1);

            TabPage tabPage = TC_ProgramingLanguages.SelectedTab;

            tabPage.Controls.Add(this.LB_CodeName);
            tabPage.Controls.Add(this.TXTBOX_Code);
            tabPage.Controls.Add(this.TXTBOX_CodeDescription);
            BTN_DeleteProgramingLanguage.Show();
            BTN_DeleteCode.Show();
            BTN_DeleteCode.Enabled = false;

            LoadCodeSnippetList(-1);
            TXTBOX_ProgramingLanguageName.Text = "";
            BTN_AddProgramingLanguage.Enabled  = false;
            BTN_DeleteCode.Enabled             = false;
        }