Results 1 to 8 of 8

Thread: Button.click delay

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    265

    Button.click delay

    i have this bizare issue and can't see what is causing it. on my form i have about 20 buttons with code in the click events. one particular button hangs for about 15 seconds before triggering the first line of code, note this only occurs on the first load of the form (frm.showdialog(me)) when the application is fired.
    i put in some code to record time stamps in an sql table, to try and catch the code delaying it, but apparently, it is hanging on the click event and then it flicks through the code. any one seen this before ?
    another question, is it possible to disable the control autoscaling when running the application in a different environment (e.g. smaller screen resolution) , options are font, dpi, inherit and none. tried all 4 of them but none seems to do the trick

    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Button.click delay

    Firstly, please don't ask unrelated questions in the same thread. It just makes it harder for everyone. If have questions on two different topics then please create two different threads that each have a title that describes that topic.

    With regards to your first question, which is the one that relates to the title of the thread and therefore the only one I will address, is the Button on the form being displayed as a dialogue or is the form being displayed as a dialogue from that Button's Click event handler? What else is on the form? Is there any data access or the like?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    265

    Re: Button.click delay

    Button is on a form that is displayed as a dialog. there is another 15 buttons with no such problems, and a read only text box. No data access preceeds the click event. and it only occurs on the very first load of the parent form.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Button.click delay

    How are you diagnosing this? If you put a breakpoint on the first line in the button click handler, does the breakpoint get hit before the delay, or after?
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    265

    Re: Button.click delay

    Quote Originally Posted by Shaggy Hiker View Post
    How are you diagnosing this? If you put a breakpoint on the first line in the button click handler, does the breakpoint get hit before the delay, or after?
    After

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Button.click delay

    Then I've never seen this. The length of the delay suggests that an exception is being raised and caught internally. Alternatively, some rather long running process would have to be launched as a result of that button click, but no such process comes to mind, nor can I think of exactly where it would be happening for you to get results like you describe.

    Is there anything different about that one button from any others, such as painting of the button, multiple handlers, or anything like that?
    My usual boring signature: Nothing

  7. #7
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,712

    Re: Button.click delay

    note this only occurs on the first load of the form (frm.showdialog(me)) when the application is fired.
    i put in some code to record time stamps in an sql table, to try and catch the code delaying it, but apparently, it is hanging on the click event and then it flicks through the code. any one seen this before ?
    Two questions:
    1) What OS are you using
    2) What bit OS are you using
    3) When you say 'flicks' through the code, do you mean it processes the first half and not the last portion?

    Edit - Well apparently I can't count, two questions plus one.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Button.click delay

    Giving a bit extra, I see.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width