Threads and FormClosing

Discussion in 'Programming General' started by Supah Fly, Dec 18, 2008.

Threads and FormClosing
  1. Unread #21 - Dec 21, 2008 at 10:20 PM
  2. BigBwoi2001
    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0

    BigBwoi2001 Member

    Threads and FormClosing

    Couldn't you also do this.

    Code:
    this.FormClosing {press tab 2 times}
    
     
  3. Unread #22 - Dec 22, 2008 at 3:31 AM
  4. Supah Fly
    Joined:
    Aug 22, 2007
    Posts:
    202
    Referrals:
    1
    Sythe Gold:
    0

    Supah Fly Active Member
    Banned

    Threads and FormClosing

    im using visual studio its the same, after i re-read what you posted i got what you meant lol. i never knew about that xD
     
  5. Unread #23 - Dec 22, 2008 at 5:17 AM
  6. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Threads and FormClosing

    hehe ok good, I'm glad I could help :)

    and I'm sorry Swan.. will do that next time :laugh:



    ehh, no I don't think so... I guess you want to close the form when you have pressed Tab two times... I'm pretty sure there is better ways to do it but this could be one way :p

    Code:
            bool keyPressedOnce = false;
            private void Form1_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Tab && keyPressedOnce == true)
                {
                    this.Dispose();
                }
            }
    
            private void Form1_KeyUp(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Tab)
                {
                    keyPressedOnce = true;
                }
            }
    
     
  7. Unread #24 - Dec 22, 2008 at 6:12 PM
  8. BigBwoi2001
    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0

    BigBwoi2001 Member

    Threads and FormClosing

    No, you put that in the code and it generates a function that automaticly handles the form closing event. lol.
     
  9. Unread #25 - Dec 22, 2008 at 7:36 PM
  10. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Threads and FormClosing

    ehh huh?o_O
     
  11. Unread #26 - Dec 22, 2008 at 9:42 PM
  12. Supah Fly
    Joined:
    Aug 22, 2007
    Posts:
    202
    Referrals:
    1
    Sythe Gold:
    0

    Supah Fly Active Member
    Banned

    Threads and FormClosing

    No... I can say safely it doesn't work that way lol.
     
  13. Unread #27 - Dec 23, 2008 at 6:28 AM
  14. BigBwoi2001
    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0

    BigBwoi2001 Member

    Threads and FormClosing

  15. Unread #28 - Dec 23, 2008 at 10:19 AM
  16. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    Threads and FormClosing

    ahh, lol! I know that but I misunderstood what you meant with "Press tab 2 times" xD but yes you're right, I'm sorry :p
     
  17. Unread #29 - Dec 24, 2008 at 9:47 AM
  18. BigBwoi2001
    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0

    BigBwoi2001 Member

    Threads and FormClosing

    haha its kwl, I knew I didn't word it to well.
     
< i need to understand the basics | FAWG-Online >

Users viewing this thread
1 guest


 
 
Adblock breaks this site