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. Check Target Form in Live????

Check Target Form in Live????

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    ASysSolvers
    wrote on last edited by
    #1

    In my code I am going to hide my active form and show another form. In that case are there any way to check me that other(2nd) form is loaded or not, Something like to check null or not. Because currently I am facing for a problem that is sometime my form going crashed and nothing display, at the same time my other form is already hide. Then my application is something like losen(hang). I j’t want a solution for that.

    C D 2 Replies Last reply
    0
    • A ASysSolvers

      In my code I am going to hide my active form and show another form. In that case are there any way to check me that other(2nd) form is loaded or not, Something like to check null or not. Because currently I am facing for a problem that is sometime my form going crashed and nothing display, at the same time my other form is already hide. Then my application is something like losen(hang). I j’t want a solution for that.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      ASysSolvers wrote:

      sometime my form going crashed and nothing display,

      your best fix is to fix the code in this form. Also, a good solution is to have both forms as controls and show them on the one form.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • A ASysSolvers

        In my code I am going to hide my active form and show another form. In that case are there any way to check me that other(2nd) form is loaded or not, Something like to check null or not. Because currently I am facing for a problem that is sometime my form going crashed and nothing display, at the same time my other form is already hide. Then my application is something like losen(hang). I j’t want a solution for that.

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        In the code in the first form that displays the second form, after declaring the second form's instance but before calling show() subscribe to the second form's Shown event. Then, in the handler, hide the first form.

        Form2 f2 = new Form2();
        f2.Shown += new EventHandler(f2_Shown);
        f2.Show();

        void f2_Shown(object sender, EventArgs e)
        {
        Hide();
        }

        Dave

        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