Adblock breaks this site

Threads and FormClosing

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

  1. BigBwoi2001

    BigBwoi2001 Member

    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0
    Threads and FormClosing

    Couldn't you also do this.

    Code:
    this.FormClosing {press tab 2 times}
    
     
  2. Supah Fly

    Supah Fly Active Member
    Banned

    Joined:
    Aug 22, 2007
    Posts:
    202
    Referrals:
    1
    Sythe Gold:
    0
    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
     
  3. hampe-92

    hampe-92 Forum Addict

    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0
    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;
                }
            }
    
     
  4. BigBwoi2001

    BigBwoi2001 Member

    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0
    Threads and FormClosing

    No, you put that in the code and it generates a function that automaticly handles the form closing event. lol.
     
  5. hampe-92

    hampe-92 Forum Addict

    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0
    Threads and FormClosing

    ehh huh?o_O
     
  6. Supah Fly

    Supah Fly Active Member
    Banned

    Joined:
    Aug 22, 2007
    Posts:
    202
    Referrals:
    1
    Sythe Gold:
    0
    Threads and FormClosing

    No... I can say safely it doesn't work that way lol.
     
  7. BigBwoi2001

    BigBwoi2001 Member

    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0
    Threads and FormClosing

  8. hampe-92

    hampe-92 Forum Addict

    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0
    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
     
  9. BigBwoi2001

    BigBwoi2001 Member

    Joined:
    Jul 4, 2008
    Posts:
    54
    Referrals:
    0
    Sythe Gold:
    0
    Threads and FormClosing

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


 
 
Adblock breaks this site