Exemplo n.º 1
0
        public mainForm()
        {
            InitializeComponent();
            modulesDir = Environment.CurrentDirectory/* + "\\modules"*/;
            this.FormClosing += new FormClosingEventHandler(mainForm_FormClosing);
            dgridSelectedModules.ColumnWidthChanged += new DataGridViewColumnEventHandler(dgridSelectedModules_ColumnWidthChanged);
            dgridModules.ColumnWidthChanged += new DataGridViewColumnEventHandler(dgridModules_ColumnWidthChanged);
            this.Resize += new EventHandler(mainForm_Resize);
            splitContainerModules.SplitterMoved += new SplitterEventHandler(splitContainerModules_SplitterMoved);
            laba = new Work("Без названия");
            this.Text += " - Без названия";
            dgridSelectedModules.DoubleClick += new EventHandler(dgridSelectedModules_DoubleClick);
            dgridSelectedModules.RowStateChanged += new DataGridViewRowStateChangedEventHandler(dgridSelectedModules_RowStateChanged);
            dgridModules.RowStateChanged += new DataGridViewRowStateChangedEventHandler(dgridModules_RowStateChanged);

            //properties = new PropertiesTable();
            //properties.Dock = DockStyle.Fill;
            //splitContainer.Panel1.Controls.Add(properties);
            //properties.PropertyChanged += new PropertiesTable.PropertyChangedEventHandler(properties_PropertyChanged);
            //label1.SendToBack();
        }
Exemplo n.º 2
0
 private void openWork(object sender, EventArgs e)
 {
     if ((!notSaved || MessageBox.Show(this, "Вы действительно хотите открыть другую лабораторную работу?\n" +
         "Все несохранённые изменения будут потеряны.",
         "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         && openLabDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         laba = Work.LoadFormFile(openLabDialog.FileName, dgridSelectedModules);
         сохранитьToolStripButton.Enabled = notSaved = false;
     }
 }