CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2001
    Posts
    1

    Problem with timer control

    I am using timer control in my application. The problem is that it behaves different when I run the application from the VB environment and when I run exe file.

    In vb environment, if there is a message box displayed, the timer event does not happen until you respond to that message box. (Thats what I want)

    But when i create exe and run it, the timer event is fired even there is a message box displayed (which I dont want)

    Any help will be appreciated.

    Thanks,
    Zafar


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Problem with timer control

    I think to solve this problem, what u need to do is to declare a public variable,

    dim x as long

    set the variable to some value, before trigger the message box and in the timer event, check the variable before executing any code, like this


    x = 1
    msgbox
    x = 0

    in timer event function

    if x <> 1 then
    do something...
    end if

    so, timer will be trigger but code wouldn't be executed cause the variable x become 1 before the msgbox is triggered.

    HTH

    cksiow
    http://vblib.virtualave.net - share our codes



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

Featured