Exemple #1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtTableName.Text == null)
     {
         MessageBox.Show("Please enter the name of the new table.", "No Text");
     }
     else
     {
         frmNew fn = ((frmNew)(this.Owner));          //set the owner of this form
         fn.lblCurrentTable.Text = txtTableName.Text; // set the public label of the owner form to the text in the current form
         this.Close();
     }
 }
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtFieldName.Text == null)
     {
         MessageBox.Show("Please enter the name of the new table.", "No Text");
     }
     else
     {
         frmNew fn = ((frmNew)(this.Owner)); //set the owner of this form
         fn.Field_Name = txtFieldName.Text;  // set the field name string of the owner form to the text in the current form
         int index = cboDatatype.SelectedIndex;
         this.Close();
     }
 }
Exemple #3
0
 private void mnuNew_Click(object sender, EventArgs e)
 {
     if (fn == null)
     {
         SaveFileDialog sfd = new SaveFileDialog();
         sfd.Filter   = "Access Database File|*.accdb";
         sfd.FileName = "New 1";
         sfd.Title    = "Save the Access Database File";
         if (sfd.ShowDialog() == DialogResult.OK)
         {
             filepath = sfd.FileName;
             frmNew fn = new frmNew();
             fn.MdiParent      = this;
             ((frmNew)fn).Text = Path.GetFileNameWithoutExtension(sfd.FileName);
             fn.Filepath_new   = Filepath_main;
             fn.FormClosed    += Fn_FormClosed;
             fn.Show();
         }
     }
     else
     {
         fn.Activate();
     }
 }
Exemple #4
0
 private void Fn_FormClosed(object sender, FormClosedEventArgs e)
 {
     fn = null;
 }