Closed manusoft closed 1 year ago
Change method "TerminateOnClose" in "MaterialForm.cs" (~ at Line 651]
Before:
private void TerminateOnClose(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
After:
private void TerminateOnClose(object sender, FormClosedEventArgs e)
{
if (Application.OpenForms.Count > 0 && this == Application.OpenForms[0])
Application.Exit();
}
This will fix this problem.
or shorter:
//Close application only if only one form is open (the MainForm
if (Application.OpenForms.Count == 1) Application.Exit();
Another native option is:
if (ActiveMdiChild != null) Application.Exit();
Thank you all.
@falcomus
@jmelendezdev
where do I find that file? because when installing through nuget, it only finds *.dll files i use vb.net, not C
Hello, you can download the source code here:https://github.com/IgnaceMaes/MaterialSkin Don't know if there are VisualBasic sources available, if you can't find it - maybe you can convert the C# files with a VB to C# converter.I did a conversion from VB to C#, it worked like a charm. Ithink it should work in both directions.
If you have the sources, embed the project in your solution and add a reference to this project in your main project.
I have two forms in my project frmContactList and frmContact. When I start the program it will show frmContact then i will click Create button to show frmContact. The problem is when I close frmContact form, it will close all forms. How can I fix this.