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. (winforms) making a window unselectable

(winforms) making a window unselectable

Scheduled Pinned Locked Moved C#
questioncsharpwinforms
7 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.
  • R Offline
    R Offline
    ruanr
    wrote on last edited by
    #1

    Hi, I want to make one window unselectable while I capture some info from another (basically a popup that will be displayed over the first). How do I stop the user from changing the window's focus? I suppose I could hide the one window, but that's not really what I'm looking to do. Thanks Ruan

    R 1 Reply Last reply
    0
    • R ruanr

      Hi, I want to make one window unselectable while I capture some info from another (basically a popup that will be displayed over the first). How do I stop the user from changing the window's focus? I suppose I could hide the one window, but that's not really what I'm looking to do. Thanks Ruan

      R Offline
      R Offline
      ruanr
      wrote on last edited by
      #2

      Found the answer: this.CanFocus = false;

      U R 2 Replies Last reply
      0
      • R ruanr

        Found the answer: this.CanFocus = false;

        U Offline
        U Offline
        Urs Enzler
        wrote on last edited by
        #3

        Or Show the "Popup" Form as a modal dialog.

        -^-^-^-^-^- no risk no funk

        R 1 Reply Last reply
        0
        • R ruanr

          Found the answer: this.CanFocus = false;

          R Offline
          R Offline
          ruanr
          wrote on last edited by
          #4

          Unfortunately, that's a read-only property X|

          1 Reply Last reply
          0
          • U Urs Enzler

            Or Show the "Popup" Form as a modal dialog.

            -^-^-^-^-^- no risk no funk

            R Offline
            R Offline
            ruanr
            wrote on last edited by
            #5

            Do you mind elaborating? I'm new to winforms.

            R 1 Reply Last reply
            0
            • R ruanr

              Do you mind elaborating? I'm new to winforms.

              R Offline
              R Offline
              ruanr
              wrote on last edited by
              #6

              Nevermind, problem solved. Using showDialog(parent) instead of just show causes the desired effect :)

              U 1 Reply Last reply
              0
              • R ruanr

                Nevermind, problem solved. Using showDialog(parent) instead of just show causes the desired effect :)

                U Offline
                U Offline
                Urs Enzler
                wrote on last edited by
                #7

                Yes exactly. Your were to fast for me - it was just lunch time here :-) Happy Programming Urs

                -^-^-^-^-^- no risk no funk

                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