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. Control forms of an app

Control forms of an app

Scheduled Pinned Locked Moved C#
question
6 Posts 3 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.
  • D Offline
    D Offline
    dj_jeff
    wrote on last edited by
    #1

    I have a main form for entry purposes shown in the taskbar. After I click on the OK button it starts a class method routine opening a status form. This should not be shown in taskbar. After doing some operation this window should automatically close. Question: If I switch back to my application in taskbar, I would like to get shown the status form and not the main form. What I've tried: 1. Opening status form with ShowDialog method. + Switching to the application shows the status form - All following operations are halted until status form is closed 2. Set TopMost attribute + switching to the application shows the status form - Status form's always on top 3. Opening status form with Show method + All following operations are running afterwards - Switching to the application shows the main window

    B N 2 Replies Last reply
    0
    • D dj_jeff

      I have a main form for entry purposes shown in the taskbar. After I click on the OK button it starts a class method routine opening a status form. This should not be shown in taskbar. After doing some operation this window should automatically close. Question: If I switch back to my application in taskbar, I would like to get shown the status form and not the main form. What I've tried: 1. Opening status form with ShowDialog method. + Switching to the application shows the status form - All following operations are halted until status form is closed 2. Set TopMost attribute + switching to the application shows the status form - Status form's always on top 3. Opening status form with Show method + All following operations are running afterwards - Switching to the application shows the main window

      B Offline
      B Offline
      BobJanova
      wrote on last edited by
      #2

      Try handling the main form's Activated event and activating the status form instead. Alternatively, adjust your design so if the user's supposed to be able to keep editing on the main form, a summary of the status is available on that form (status line? a panel that appears like Visual Studio's error pane?).

      1 Reply Last reply
      0
      • D dj_jeff

        I have a main form for entry purposes shown in the taskbar. After I click on the OK button it starts a class method routine opening a status form. This should not be shown in taskbar. After doing some operation this window should automatically close. Question: If I switch back to my application in taskbar, I would like to get shown the status form and not the main form. What I've tried: 1. Opening status form with ShowDialog method. + Switching to the application shows the status form - All following operations are halted until status form is closed 2. Set TopMost attribute + switching to the application shows the status form - Status form's always on top 3. Opening status form with Show method + All following operations are running afterwards - Switching to the application shows the main window

        N Offline
        N Offline
        Nitheesh George
        wrote on last edited by
        #3

        Hi, From your posting I think that you want to show the main form in taskbar and not the status form when it displayed. To solve this issue try setting parent property of the status form. Hope this helps. Nitheesh George http://www.simpletools.co.in

        D 1 Reply Last reply
        0
        • N Nitheesh George

          Hi, From your posting I think that you want to show the main form in taskbar and not the status form when it displayed. To solve this issue try setting parent property of the status form. Hope this helps. Nitheesh George http://www.simpletools.co.in

          D Offline
          D Offline
          dj_jeff
          wrote on last edited by
          #4

          How can I do that? That's how I currently control my forms. frmMain- Form: - Clicked event on a button creates object of an action class clsUsage _clsUsage = new clsUsage(); _clsUsage.CalcUsage(); CalcUsage calls and closes the status form frmStatus _frmStatus = new frmStatus(); _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close();

          N 1 Reply Last reply
          0
          • D dj_jeff

            How can I do that? That's how I currently control my forms. frmMain- Form: - Clicked event on a button creates object of an action class clsUsage _clsUsage = new clsUsage(); _clsUsage.CalcUsage(); CalcUsage calls and closes the status form frmStatus _frmStatus = new frmStatus(); _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close();

            N Offline
            N Offline
            Nitheesh George
            wrote on last edited by
            #5

            Hi try the following. frmStatus _frmStatus = new frmStatus(); frmStatus.parent = this; frmStatus.showInTaskbar = false; _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close(); hope this helps Nitheesh George http://www.simpletools.co.in

            D 1 Reply Last reply
            0
            • N Nitheesh George

              Hi try the following. frmStatus _frmStatus = new frmStatus(); frmStatus.parent = this; frmStatus.showInTaskbar = false; _frmStatus.Show(); //doing some operations and modifying attributes to controls of frmStatus form _frmStatus.Close(); hope this helps Nitheesh George http://www.simpletools.co.in

              D Offline
              D Offline
              dj_jeff
              wrote on last edited by
              #6

              Not so easy because the call of the form is in my action class. Tried the following. //created a property in action class private Form parentForm; public Form ParentForm { get { return parentForm; } set { parentForm = value; } } //in frmMain in clicked event added _clsUsage.ParentForm = this; //in the action class in the action method _frmStatus.Parent = ParentForm; But this creates an ArgumentException.

              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