CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2000
    Posts
    3

    How to close a Frame via MouseClick?

    Hi there!

    I made a little Program which uses a Frame with Labels in it to show some Text.
    The Problem i have is how to close this Frame just by clicking on it with my Mouse.

    I allready implements MouseListener and implments all the methods it needs, but it wont close if i click in it.

    Thanks for your help...

    Trollpower


  2. #2
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    Re: How to close a Frame via MouseClick?

    Do you mean that you want to close the frame whereever you click on it?

    Kannan



  3. #3
    Join Date
    May 2000
    Posts
    3

    Re: How to close a Frame via MouseClick?

    yes. But for the beginning it is ok if i have to click on a single spot in the Frame (Title, Screen).

    Greetings

    Trollpower


  4. #4
    Join Date
    May 2000
    Posts
    3

    Re: How to close a Frame via MouseClick?

    i thought that i can add such a Listener simply by "putting" it around the Object itself. For example:

    mouseListener(){
    Frame myFrame = new Frame();}

    something in this way, you know?

    Trollpower


  5. #5
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: How to close a Frame via MouseClick?




    frame.hide();
    frame.dispose();

    System.exit( 0 ) // If you like to terminate the application.





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured