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. Visual Basic
  4. Disable form not fast enough

Disable form not fast enough

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
7 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
    Didier Cauberghe
    wrote on last edited by
    #1

    Hello, I have the following question. I have written a VB 2008 program for registering Rooms in a Hotel. Using a Touch Screen for entering everythin so there is no keyboard and mouse installed on the PC. So i have a buttom for every room on a main screen. When pressing for example room 2 , there is a new form that opens on top of the main form. in the main programm is have frmxxx.show(). In the frmxxx() i have set in the load : FrmMain.enabled = false So it is not possible anymore to click on the main form , so i have blocked that the users can change the form back to the main. Now the problem : sometimes , the user is clicking to fast i think (before the frmMain.enabled = false) and the main window is coming on top of the frmxxx. so the mainform is hiding the smaller frmxxx so the user has a big main form wich is at that time disabled. so the screens are on top. The only way to solve this is with a keyboard CTRL-TAB but because of the missing keyboard (due to the touch screen) it is not possible. I have already tried to set the main form enabled = false before opening the frmxxx. but this is not working when the mainform is still active. I dont want to hide the main form , so i wnat it set to disabled. Does anyone can give me advise on this maybe stupid question. Thanks Best regards DCA

    R 1 Reply Last reply
    0
    • D Didier Cauberghe

      Hello, I have the following question. I have written a VB 2008 program for registering Rooms in a Hotel. Using a Touch Screen for entering everythin so there is no keyboard and mouse installed on the PC. So i have a buttom for every room on a main screen. When pressing for example room 2 , there is a new form that opens on top of the main form. in the main programm is have frmxxx.show(). In the frmxxx() i have set in the load : FrmMain.enabled = false So it is not possible anymore to click on the main form , so i have blocked that the users can change the form back to the main. Now the problem : sometimes , the user is clicking to fast i think (before the frmMain.enabled = false) and the main window is coming on top of the frmxxx. so the mainform is hiding the smaller frmxxx so the user has a big main form wich is at that time disabled. so the screens are on top. The only way to solve this is with a keyboard CTRL-TAB but because of the missing keyboard (due to the touch screen) it is not possible. I have already tried to set the main form enabled = false before opening the frmxxx. but this is not working when the mainform is still active. I dont want to hide the main form , so i wnat it set to disabled. Does anyone can give me advise on this maybe stupid question. Thanks Best regards DCA

      R Offline
      R Offline
      Rob Smiley
      wrote on last edited by
      #2

      sounds like you should be using ShowDialog instead of Show. ShowDialog will automatically 'block' the main form, so you don't need to worry about disabling it

      "An eye for an eye only ends up making the whole world blind"

      D 1 Reply Last reply
      0
      • R Rob Smiley

        sounds like you should be using ShowDialog instead of Show. ShowDialog will automatically 'block' the main form, so you don't need to worry about disabling it

        "An eye for an eye only ends up making the whole world blind"

        D Offline
        D Offline
        Didier Cauberghe
        wrote on last edited by
        #3

        Hello, Can i use the showdialog() with more that 2 forms. So i have the mainform , i opens a second form with frmxxx.showdialog and on that second form there are again a few buttons wich i use to open a 3th form , can i use the same showdialog there ? thanks DCA

        D 1 Reply Last reply
        0
        • D Didier Cauberghe

          Hello, Can i use the showdialog() with more that 2 forms. So i have the mainform , i opens a second form with frmxxx.showdialog and on that second form there are again a few buttons wich i use to open a 3th form , can i use the same showdialog there ? thanks DCA

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

          No, you can only use it with one form from the mainform, but YES you can keep calling ShowDialog from the Parent to Childs. what you can also do is set the AlwaysOnTop property to true on the 'popup' form which will change the ZOrder of the forms, keeping it in front.

          Dave Don't forget to rate messages!
          Find Me On: Web|Facebook|Twitter|LinkedIn
          Waving? dave.m.auld[at]googlewave.com

          D 1 Reply Last reply
          0
          • D DaveAuld

            No, you can only use it with one form from the mainform, but YES you can keep calling ShowDialog from the Parent to Childs. what you can also do is set the AlwaysOnTop property to true on the 'popup' form which will change the ZOrder of the forms, keeping it in front.

            Dave Don't forget to rate messages!
            Find Me On: Web|Facebook|Twitter|LinkedIn
            Waving? dave.m.auld[at]googlewave.com

            D Offline
            D Offline
            Didier Cauberghe
            wrote on last edited by
            #5

            When i have 3 forms mainform , form1 and form2 From the mainform i need to open form1 wich need to be set active (on this time the main form may not be accessable). From the form1 that is on top of the (blocked)mainform i need to open from2 wich comes on top of form1 , so form1 must also be disabled like frmmain. and form2 must be active only. When clicking on the OK button on Form2 the form2 needs to be disapear and frm1 needs to come active again , frmmain is still deactivated until ok isclicked on frm1. My problem was when using form.enabled that is was to slow and the user was clicking to fast so the wrong forms came on top of eachother and where locked . can you help me with this please. thanks. DCA

            D 1 Reply Last reply
            0
            • D Didier Cauberghe

              When i have 3 forms mainform , form1 and form2 From the mainform i need to open form1 wich need to be set active (on this time the main form may not be accessable). From the form1 that is on top of the (blocked)mainform i need to open from2 wich comes on top of form1 , so form1 must also be disabled like frmmain. and form2 must be active only. When clicking on the OK button on Form2 the form2 needs to be disapear and frm1 needs to come active again , frmmain is still deactivated until ok isclicked on frm1. My problem was when using form.enabled that is was to slow and the user was clicking to fast so the wrong forms came on top of eachother and where locked . can you help me with this please. thanks. DCA

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

              You can use the ShowDialog() in this instance. i.e. on the mainform call form1.showdialog, and on form1 call form2.showdialog

              Dave Don't forget to rate messages!
              Find Me On: Web|Facebook|Twitter|LinkedIn
              Waving? dave.m.auld[at]googlewave.com

              D 1 Reply Last reply
              0
              • D DaveAuld

                You can use the ShowDialog() in this instance. i.e. on the mainform call form1.showdialog, and on form1 call form2.showdialog

                Dave Don't forget to rate messages!
                Find Me On: Web|Facebook|Twitter|LinkedIn
                Waving? dave.m.auld[at]googlewave.com

                D Offline
                D Offline
                Didier Cauberghe
                wrote on last edited by
                #7

                Thanks That is the correct solution. best regards DCA

                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