• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

.Net click through forms

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    .Net click through forms

    Have a button on a child form that opens another child form with a button in much the same place. If somebody double clicks on the first form, it clicks the button on the second form. Tried sticking flags and checks in various events but nothing works.

    Someone has suggested using a timer and only showing the second form or enabling its button after a delay. That does work but it seems a messy sort of solution to me. Anyone know of a neater one?

    Cheers for ideas.
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    #2
    Originally posted by xoggoth View Post
    Have a button on a child form that opens another child form with a button in much the same place. If somebody double clicks on the first form, it clicks the button on the second form. Tried sticking flags and checks in various events but nothing works.

    Someone has suggested using a timer and only showing the second form or enabling its button after a delay. That does work but it seems a messy sort of solution to me. Anyone know of a neater one?

    Cheers for ideas.
    The obvious one is don't have the button in the same place as the one underneath.
    Cooking doesn't get tougher than this.

    Comment


      #3
      Ta but not possible, there are a whole load of buttons on both forms.
      bloggoth

      If everything isn't black and white, I say, 'Why the hell not?'
      John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

      Comment


        #4
        Originally posted by xoggoth View Post
        Ta but not possible, there are a whole load of buttons on both forms.
        Tell the users not to double click buttons? Do they press BBC1 twice when they change channel on the TV?

        What about ignoring the click of the child button for the first 500ms (rather than disabling it?

        create a global System.Diagnostics.Stopwatch, start it in the form init code.
        In the click handler, wrap the code in an if .ElapsedMilliseconds > 500
        Cooking doesn't get tougher than this.

        Comment


          #5
          It's for kids so they probably don't just double click, they go clcik cklickety clicketyclicktey clcick clcikchchhk...
          bloggoth

          If everything isn't black and white, I say, 'Why the hell not?'
          John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

          Comment


            #6
            Is the Double click event being triggered?

            Or is it 2 slow single clicks?

            Does sound like a user education issue though.
            Last edited by Scrag Meister; 23 March 2010, 16:47.
            Never has a man been heard to say on his death bed that he wishes he'd spent more time in the office.

            Comment


              #7
              Originally posted by Scrag Meister View Post
              Does sound like a user education issue though.
              Not really, if you need to educate users to use your interface, generally your interface design is flawed, not the users so i'm guessing re-education is not the answer he's looking for.

              Can you not just alter the part of the screen it appears on? Or is this a full screen thing. Hard to say without seeing it but i'd look to re-do the layout of the child form before fudging with timers/fade-ins etc.

              Comment


                #8
                Not practical to change forms as both have numerous "buttons", actually labels forming hot spots on a picture. Too restricting to avoid any coincidence of positions. Is the two shown at top here:

                http://www.gatekeeperel.co.uk/animalsuk.html
                bloggoth

                If everything isn't black and white, I say, 'Why the hell not?'
                John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

                Comment


                  #9
                  Xog,

                  Firstly I don't think it's a double click, otherwise the doubleclick event of the button should fire. So it's two single clicks not quick enough. The second click message is not dispatched until the click handler completes. However at this point this is just a message up the spout and the target is unknown. After the click event completes the message causes a click even on the second form because this is what is valid at that screen location at the time of dispatch.

                  The basic problem you have is that you don't want to respond to the second click until you are in a known state and that is after all message pumping.

                  If you make sure buttons on the form as disabled at load time and then enable them in the show event the second form is fine. Unfortunately this means the click will go to the first form which may be unhelpful........

                  TheBigYinJames solution is probably the pragmatic one.

                  However you could use a custom windows message and override the message queue - but this seems like a lot of faffing about.

                  Comment


                    #10
                    Or to save using a timer, store the system time at form load and if the new form's button is clicked less than 200ms or so after form load, ignore it. 3 lines of code I expect.

                    Comment

                    Working...
                    X