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. Click outside form

Click outside form

Scheduled Pinned Locked Moved C#
comquestion
5 Posts 2 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.
  • H Offline
    H Offline
    Hans Ruck
    wrote on last edited by
    #1

    Hi, From the main form of a Windows application I am creating a modal dialog (using ShowDialog). Is there any way I can detect when the user clicks outside the child form? It flashes a bit so I think it should have some sort of event behind. I have intercepted Deactivate but it seems that it's not the one.


    "la dolce ossessione degli ultimi suoi giorni tristi, Venezia, la vende ai turisti"

    rechi

    N 1 Reply Last reply
    0
    • H Hans Ruck

      Hi, From the main form of a Windows application I am creating a modal dialog (using ShowDialog). Is there any way I can detect when the user clicks outside the child form? It flashes a bit so I think it should have some sort of event behind. I have intercepted Deactivate but it seems that it's not the one.


      "la dolce ossessione degli ultimi suoi giorni tristi, Venezia, la vende ai turisti"

      rechi

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      AFAIK, you can't. This is the way modal dialogs works. Why do you want this ?


      My Website | Ask smart questions

      H 1 Reply Last reply
      0
      • N N a v a n e e t h

        AFAIK, you can't. This is the way modal dialogs works. Why do you want this ?


        My Website | Ask smart questions

        H Offline
        H Offline
        Hans Ruck
        wrote on last edited by
        #3

        N a v a n e e t h wrote:

        Why do you want this ?

        I want to destroy the child. I have tried by calling the Show method but it fails when a modal child creates a modeless child and the user clicks on the main form :(


        "la dolce ossessione degli ultimi suoi giorni tristi, Venezia, la vende ai turisti"

        rechi

        N 1 Reply Last reply
        0
        • H Hans Ruck

          N a v a n e e t h wrote:

          Why do you want this ?

          I want to destroy the child. I have tried by calling the Show method but it fails when a modal child creates a modeless child and the user clicks on the main form :(


          "la dolce ossessione degli ultimi suoi giorni tristi, Venezia, la vende ai turisti"

          rechi

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Bogdan Rechi wrote:

          I want to destroy the child

          Child ? Do you mean the modal window ? and you want the control back to Parent window ? Why don't you have a close button for your child ?


          My Website | Ask smart questions

          H 1 Reply Last reply
          0
          • N N a v a n e e t h

            Bogdan Rechi wrote:

            I want to destroy the child

            Child ? Do you mean the modal window ? and you want the control back to Parent window ? Why don't you have a close button for your child ?


            My Website | Ask smart questions

            H Offline
            H Offline
            Hans Ruck
            wrote on last edited by
            #5

            N a v a n e e t h wrote:

            Do you mean the modal window ?

            No, the configuration is: main form -> modal child -> modeless child, and I am clicking outside the modeless, outside the modal, and inside the main form. I would like to intercept the click and make the modeless disappear. It's a kind of tooltip :)


            "la dolce ossessione degli ultimi suoi giorni tristi, Venezia, la vende ai turisti"

            rechi

            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