Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

c# vs2008 winforms minimizing

Posted on 2012-12-21
2
Medium Priority
?
293 Views
Last Modified: 2012-12-21
Hello.  Suddenly I am having an issue with a couple of c#, vs2008 applicaitons recently written.  Form_1 double-click in the first case, and a context menu item click in the second case, cause new forms to pop up (showdialog)-- one to enter information which has its own save button and exit button, and one to conduct a search.  

In both cases, I use the Hide method to "close" the form (from the user's viewpoint), and then the close method in the calling program to close those pop up forms.

For example:
        private void Form1_DoubleClick(object sender, EventArgs e)
        {
            frmNotes f = new frmNotes();
            f.ConnString = this._ConnString;
            f.ShowDialog();
            f.Close();
        }


Intermittenly, then, the calling program minimizes after showing and closing these pop up forms.

What could be causing that?
0
Comment
Question by:g_johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 38713948
Not sure what's causing the minimizing issue, but...

Instead of Hide() to close the dialog, actually set DialogResult() to dismiss it.  You also don't need to Close() the dialog since it has already been dismissed.  That dialog will automatically be disposed of since it goes out of scope when the method exits.
0
 
LVL 4

Author Closing Comment

by:g_johnson
ID: 38714729
Thanks for the tip.  I'm not sure how it solved the issue, but early indications are that it did.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question