• 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!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on ".Net click through forms"

Collapse

  • ASB
    replied
    Originally posted by TheBigYinJames View Post
    Actually, there might be a slight overhead in loading the stopwatch wrapper object (needs to load the Diagnostics assembly?) so DateTimeNow.Subtract(someStoredVal) would probably be marginally quicker.

    I liked the modal dialogue suggestion.

    And all because the lady loves Milk Tray.
    Out of interest (and boredom) I had a look at it in reflector. It does have a call to a kernel function on first instantiation to discover if it's high res or not. I it calls the same functions as datetime.now does in general. I think one would need a few hundred billion iterations to find a timeable difference though..

    Leave a comment:


  • ASB
    replied
    Originally posted by TimberWolf View Post
    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.
    btw stopwatch is not a timer. It is just a wrapper round datetime. It's lightweight. However it does some more calculations than would be done with using datetime.subtract.now.subtract.

    Leave a comment:


  • TheBigYinJames
    replied
    Originally posted by ASB View Post
    I doubt there is any difference in efficiency between datetime.now.subtract and using a stopwatch.
    Actually, there might be a slight overhead in loading the stopwatch wrapper object (needs to load the Diagnostics assembly?) so DateTimeNow.Subtract(someStoredVal) would probably be marginally quicker.

    I liked the modal dialogue suggestion.

    And all because the lady loves Milk Tray.

    Leave a comment:


  • ASB
    replied
    Originally posted by TheBigYinJames View Post
    Can't remember off the top of my head what the resolution of DateTime is, in earlier .Net it was as large as 500ms. Stopwatch will use high def if it's available.
    The precision has always been (according to the Docs) 100 Nanosecs. However there are some issues:-

    https://connect.microsoft.com/Visual...?wa=wsignin1.0

    Internally the stopwatch uses datetime.utcnow - which is precisely what datetime.now does.

    I doubt there is any difference in efficiency between datetime.now.subtract and using a stopwatch.

    Leave a comment:


  • TimberWolf
    replied
    Originally posted by TheBigYinJames View Post
    Can't remember off the top of my head what the resolution of DateTime is, in earlier .Net it was as large as 500ms. Stopwatch will use high def if it's available.
    Ah, I see you'd proposed a similar and probably more exact solution earlier. My bad.

    Leave a comment:


  • Bright Spark
    replied
    display a small modal form saying "Loading..." for about 3secs when first button is pressed.

    Leave a comment:


  • TheBigYinJames
    replied
    Originally posted by TimberWolf View Post
    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.
    Can't remember off the top of my head what the resolution of DateTime is, in earlier .Net it was as large as 500ms. Stopwatch will use high def if it's available.

    Leave a comment:


  • TimberWolf
    replied
    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.

    Leave a comment:


  • ASB
    replied
    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.

    Leave a comment:


  • xoggoth
    replied
    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

    Leave a comment:


  • Durbs
    replied
    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.

    Leave a comment:


  • Scrag Meister
    replied
    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.

    Leave a comment:


  • xoggoth
    replied
    It's for kids so they probably don't just double click, they go clcik cklickety clicketyclicktey clcick clcikchchhk...

    Leave a comment:


  • TheBigYinJames
    replied
    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

    Leave a comment:


  • xoggoth
    replied
    Ta but not possible, there are a whole load of buttons on both forms.

    Leave a comment:

Working...
X