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. Problems showing another form when user activates the main form

Problems showing another form when user activates the main form

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

    Hi I have a dialog form that has validation in it. If things are invalid, another window appears with the list of errors that they can double click on and be taken to the point of the error. What I would like to do is not have this error window appear in the taskbar and have the window appear when the main dialog regains focus. I've looked arround and tried this

        private void Form1\_Activated(object sender, EventArgs e)
        {
            if (newErrorForm != null)
            {
                newErrorForm.BringToFront();
                this.Focus();
            }
        }
    

    but this causes the error window to always have focus even though I'm shifting it back to the main form. Is there a way to achieve this? Many Thanks

    The FoZ

    1 1 Reply Last reply
    0
    • T TheFoZ

      Hi I have a dialog form that has validation in it. If things are invalid, another window appears with the list of errors that they can double click on and be taken to the point of the error. What I would like to do is not have this error window appear in the taskbar and have the window appear when the main dialog regains focus. I've looked arround and tried this

          private void Form1\_Activated(object sender, EventArgs e)
          {
              if (newErrorForm != null)
              {
                  newErrorForm.BringToFront();
                  this.Focus();
              }
          }
      

      but this causes the error window to always have focus even though I'm shifting it back to the main form. Is there a way to achieve this? Many Thanks

      The FoZ

      1 Offline
      1 Offline
      1 21 Gigawatts
      wrote on last edited by
      #2

      TheFoZ wrote:

      What I would like to do is not have this error window appear in the taskbar

      There's an option "ShowInTaskbar" that stops that.

      "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair Now reading: 'The Third Reich', by Michael Burleigh

      T 1 Reply Last reply
      0
      • 1 1 21 Gigawatts

        TheFoZ wrote:

        What I would like to do is not have this error window appear in the taskbar

        There's an option "ShowInTaskbar" that stops that.

        "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair Now reading: 'The Third Reich', by Michael Burleigh

        T Offline
        T Offline
        TheFoZ
        wrote on last edited by
        #3

        I know, that is what's causing the problem. To only way to get the form back is to minimise the windows until you find it again. I just want the user to click on the dialogs button in the task bar and both windows appear.

        The FoZ

        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