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; } }
public Main() { InitializeComponent(); TC_ProgramingLanguages.TabPages.RemoveAt(0); conn = new SQLiteConnection("Data Source=CodeLog.db;"); try { conn.Open(); LoadProgramingLanguagesList(-2); } catch (Exception ex) { } SQLCommand("CREATE TABLE IF NOT EXISTS ProgramingLanguages (id INTEGER PRIMARY KEY, name VARCHAR DEFAULT NULL)"); SQLCommand("CREATE TABLE IF NOT EXISTS Codes (id INTEGER PRIMARY KEY, programinglanguage_id DEFAULT -1, name VARCHAR DEFAULT NULL, code VARCHAR DEFAULT NULL, description VARCHAR(170) DEFAULT NULL)"); BTN_DeleteProgramingLanguage.Hide(); BTN_DeleteCode.Hide(); BTN_SaveChanges.Hide(); BTN_DropChanges.Hide(); }