Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. c# form on focus

c# form on focus

Scheduled Pinned Locked Moved C#
csharpquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    benjamin yap
    wrote on last edited by
    #1

    Hi, I got 2 forms.. Form1 and Form2. When the program is executed, Form1 is called. There is a button that will open Form2. At this point of time, Form2 will be on top of Form1. After the user closes Form2, i want form1 to show something.. But i cant find the OnFocus event.. any idea?

    L 1 Reply Last reply
    0
    • B benjamin yap

      Hi, I got 2 forms.. Form1 and Form2. When the program is executed, Form1 is called. There is a button that will open Form2. At this point of time, Form2 will be on top of Form1. After the user closes Form2, i want form1 to show something.. But i cant find the OnFocus event.. any idea?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Documentation[^] shows a GotFocus event, which is probably what you want.

      Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

      B 1 Reply Last reply
      0
      • B benjamin yap

        somehow, my form dont have the GotFocus event

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I don't see how that's possible.

        Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

        J 1 Reply Last reply
        0
        • L Lost User

          Documentation[^] shows a GotFocus event, which is probably what you want.

          Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

          B Offline
          B Offline
          benjamin yap
          wrote on last edited by
          #4

          somehow, my form dont have the GotFocus event

          L L 2 Replies Last reply
          0
          • L Lost User

            I don't see how that's possible.

            Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

            J Offline
            J Offline
            jashimu
            wrote on last edited by
            #5

            this might do what you are looking for. Form1.Close(); Form2.Show(); Or Form2.Close() Form1.Show();

            1 Reply Last reply
            0
            • B benjamin yap

              somehow, my form dont have the GotFocus event

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              in WinForm every Control has a GotFocus event. so please clarify and justify your observation. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


              B 1 Reply Last reply
              0
              • L Luc Pattyn

                in WinForm every Control has a GotFocus event. so please clarify and justify your observation. :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


                B Offline
                B Offline
                benjamin yap
                wrote on last edited by
                #7

                i have look thru many times.. Do not have the GotFocus event.. Well, i think i create a static method in Form1 and before Form2 closes, it will fire Form1 method instead of using the GotFocus

                L L 2 Replies Last reply
                0
                • B benjamin yap

                  i have look thru many times.. Do not have the GotFocus event.. Well, i think i create a static method in Form1 and before Form2 closes, it will fire Form1 method instead of using the GotFocus

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  benjamin yap wrote:

                  i have look thru many times

                  through what? If you can't give clear and detailed information, people won't be able to offer effective help. :|

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                  I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


                  1 Reply Last reply
                  0
                  • B benjamin yap

                    i have look thru many times.. Do not have the GotFocus event.. Well, i think i create a static method in Form1 and before Form2 closes, it will fire Form1 method instead of using the GotFocus

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    You have one, every form that inherits from system.windows.forms.form has one.

                    Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups