C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Trainings
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Aspire
.NET Core
.NET MAUI
.NET Standard
Active Directory
ADO.NET
Agile Development
AI
AJAX
AlbertAGPT
Alchemy
Alexa Skills
Algorand
Algorithms in C#
Android
Angular
Apple
Arbitrum
ArcObject
ASP.NET
ASP.NET Core
Augmented Reality
Avalanche
AWS
Azure
Backbonejs
Base Blockchain
Big Data
Bitcoin
BizTalk Server
Blazor
Blockchain
Bootstrap
Bot Framework
Business
Business Intelligence(BI)
C#
C# Corner
C# Strings
C, C++, MFC
Career Advice
Careers and Jobs
Chapters
ChatGPT
Cloud
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Copilot
Cortana Development
Cosmos DB
Cryptocurrency
Cryptography
Crystal Reports
CSS
Current Affairs
Custom Controls
Cyber Security
Data Mining
Data Science
Databases & DBA
Databricks
Design Patterns & Practices
DevExpress
DevOps
DirectX
Docker
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
F#
Files, Directory, IO
Flutter
Games Programming
GDI+
General
Generative AI
GO
Google Cloud
Google Development
Graphics Design
Graphite Studio
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Infragistics
Internet & Web
Internet of Things
Ionic
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
Kotlin
Kubernetes
Langchain
Leadership
Learn .NET
Learn iOS Programming
LINQ
Machine Learning
Metaverse
Microsoft 365
Microsoft Fabric
Microsoft Office
Microsoft Phone
Microsoft Teams
Mobile Development
MongoDB
MuleSoft
MySQL
NEAR
NetBeans
Networking
NFT
NoCode LowCode
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Polygon
PostgreSQL
Power Apps
Power Automate
Power BI
Power Pages
Printing in C#
Products
Progress
Progressive Web Apps
Project Management
Prompt Engineering
Public Speaking
Python
Q#
QlikView
Quantum Computing
R
React
React Native
Reports using C#
RevealBi
Robotics & Hardware
RPA
Ruby on Rails
RUST
Salesforce
Security
Servers
ServiceNow
SharePoint
Sharp Economy
SignalR
Smart Devices
Snowflake
Software Architecture/Engineering
Software Testing
Solana
Solidity
Sports
SQL
SQL Server
Startups
Stratis Blockchain
Swift
SyncFusion
Threading
Tools
TypeScript
Unity
UWP
Vibe Coding
Visual Basic .NET
Visual Studio
Vue.js
WCF
Wearables
Web API
Web Design
Web Development
Web3
Windows
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML
XML
XNA
XSharp
Register
Login
3
Answers
Problem with Minimized Main Form
Behrouz Hosseini
13y
1.6k
0
1
Reply
Hi Guys
Can you please take a look at following app to see what I am doing wrong?
Download App(WinFormsStarts)
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
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
How can i Save captured images from webcam with different file names
Crystal Reports