Beispiel #1
0
        //public void ResizeForm()
        //{
        //    //CHANGING FORM HEIGHT RESPONSIVELY DEPENDING ON NUMBER OF OPTIONS
        //    if (Options.Count() > InitialListViewItemCount && Options.Count() < MaximumListViewItemCount)
        //        Size = new System.Drawing.Size(InitialFormWidth, InitialFormHeight + (Options.Count() - InitialListViewItemCount) * ListOptionHeight);
        //    else if (Options.Count() >= MaximumListViewItemCount)
        //        Size = new System.Drawing.Size(InitialFormWidth, InitialFormHeight + (ListOptionHeight * AditionalListViewItemCount));
        //    else if (Bounds.Height != InitialFormHeight)
        //        Size = new System.Drawing.Size(InitialFormWidth, InitialFormHeight);
        //}

        private void ButtonAddOption_Click(object sender, EventArgs args)
        {
            try
            {
                FormEditOptions form = new FormEditOptions(this);
                form.Show();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Beispiel #2
0
 private void EditSelectedOption()
 {
     try
     {
         ListViewItem    item   = listViewOptions.SelectedItems[0];
         Options         option = Options.Find(o => o.Id == (int)item.Tag);
         FormEditOptions edit   = new FormEditOptions(this, option);
         edit.Show(this);
     }
     catch (ArgumentOutOfRangeException)
     {
         MessageBox.Show("Select an option for editing.");
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }