Hi Guys
Can you please take a look at following app to see what I am doing wrong?
What I want to do is running multiple modal forms AND keeping the MainApp form accessible until finishing all required modals.As you can see from the application, as soon as you run the program the MainApp form (in Maximized windows State) and the Welcome form pops up.
till here everything is fine but when I chose the "Start New Project" the QuickStart form pops up BUT the MainApp minimize which is not meant to be.
This issue also happen when user chose the "Start Existing Project" then the MainApp minimize again and the Open dialog appear on the screen.
Here are the codes ,as well:
1- MainApp
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WinFormStarts
{
public partial class MainApp : Form
{
public MainApp()
{
InitializeComponent();
}
private void MainApp_Load(object sender, EventArgs e)
{
Welcome welcomeForm = new Welcome();
welcomeForm.ShowDialog();
}
}
}
2- Welcome Form
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WinFormStarts
{
public partial class Welcome : Form
{
public Welcome()
{
InitializeComponent();
}
private void btnExisting_Click(object sender, EventArgs e)
{
this.Hide();
OpenFileDialog dlg = new OpenFileDialog();
dlg.ShowDialog();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
Application.Exit();
}
private void btnNew_Click(object sender, EventArgs e)
{
this.Hide();
QuickStart qs = new QuickStart();
qs.ShowDialog();
}
}
}
3- QuickStart Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WinFormStarts
{
public partial class QuickStart : Form
{
public QuickStart()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
Application.Exit();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Please let me know what is wrong with this apss. Thanks for your time in advanced