A simple way to close all opend windows by click on Close button


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: A simple way to close all opend windows by click on Close button

  1. #1
    Dajing Hu Guest

    A simple way to close all opend windows by click on Close button


    Is there any simlpe way to close ALL opend Windows by click on Close buton
    in upper right corner in any forms(No MDI from(s))?

    For example there 4 forms opened, I want to be able to close the project
    by click on Close Button at upper right corner in any forms-- (have to close
    every form first right? Using a from's hWnd? how?)

    Dajing

  2. #2
    Craig Clearman Guest

    Re: A simple way to close all opend windows by click on Close button

    Dajing,

    >Is there any simlpe way to close ALL opend Windows by click on Close buton
    >in upper right corner in any forms(No MDI from(s))?


    Essentially, you'll want to use code like this:

    Dim i As Long

    For i = 0 To Forms.Count - 1
    If Forms(i) Is Me Then
    'Already unloading
    Else
    Unload Forms(i)
    End If
    Next i

    Ciao, Craig


  3. #3
    Craig Clearman Guest

    Re: A simple way to close all opend windows by click on Close button

    Dajing,

    >Is there any simlpe way to close ALL opend Windows by click on Close buton
    >in upper right corner in any forms(No MDI from(s))?


    Essentially, you'll want to use code like this:

    Dim i As Long

    For i = 0 To Forms.Count - 1
    If Forms(i) Is Me Then
    'Already unloading
    Else
    Unload Forms(i)
    End If
    Next i

    Ciao, Craig


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center