Example #1
0
        private void btnNewEntry_Click(object sender, EventArgs e)
        {
            // Get the Next Subtable EntryID
            var thissubTableId = Convert.ToInt32(ProgSettings.GetNewSubTableId());

            var thisSubtableName = "";
            var returnVal        = ProgSettings.ShowInputDialog(ref thisSubtableName, "subTable Name");

            // If the user clicked ok, add the new table
            if (returnVal != DialogResult.OK)
            {
                return;
            }
            // Add to the table
            ProgSettings.SubTableInsert(thissubTableId, lstLangs.SelectedIndex, thisSubtableName, "To be populated",
                                        "To be populated");
            SubTableId = thissubTableId;

            // Add it to the listbox and select it
            lstsubtables.Items.Add(thisSubtableName);

            var intSubTableListIndex = lstsubtables.Items.IndexOf(thisSubtableName);

            lstsubtables.SelectedIndex = intSubTableListIndex; // lstsubtables.Items.Count - 1;

            blnTextChanged  = true;
            btnSave.Enabled = true;
            mnuSave.Enabled = btnSave.Enabled;
        }