473,787 Members | 2,938 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timer1 wont re-enable...vb.net

3 New Member
Ok heres the jist...

in the Timer1_Tick sub which is within the form1

i call
Expand|Select|Wrap|Line Numbers
  1. If something = true then
  2. Timer1.enabled=false
  3. ''Call a sub thats within a module to do something using the threadpool 
  4. ThreadPool.QueueUserWorkItem( New WaitCallback(AddressOf MySub)
  5. end if
  6.  
Now at the end of the sub {which is adding items to a DB i call it}
Expand|Select|Wrap|Line Numbers
  1. form1.timer1.enabled=true
  2. debug.print(form1.timer1.enabled) 'it gives me true
  3.  
Seems simple enough right? well it doesnt ever re-start..by that i mean the private sub timer1_tick never fires again.

Do you think the GC is collecting it since i disable it? The function can take a minute or so to run while its disabled.


Any ideas how to fix this issue?
Aug 30 '11 #1
1 1999
kadghar
1,295 Recognized Expert Top Contributor
mmm, i dont think the gc is collecting it, since its a control in the form. Why dont you try re-asigning it some interval after you re-enable it?
Sep 8 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2525
by: KS | last post by:
In want to visualy drag a Button to a Label and when I depress the mousebutton on top of the label I want to show some dato from the Button in a MsgBox - that's my primary goal. I have made a simple sample code - a form with a Button1, a Label1 and a Timer1. The Button1 has Tag="SomeData", the Label1 has AllowDrop=True and the Timer1 has an Interval=20.
11
2401
by: Jay | last post by:
Hey Guys, I need an algorithm/formula to do the following: I have two 32-bit timers cascaded to form a 64-bit timer, max value per timer(50sec). This is the way they work: value | timer1 | timer2 5 50 3 when timer1 counts down to zero, timer2 would count down to two.
5
2068
by: Leon | last post by:
Is there a way I can create a thread at application level that running all the time along with application exists? I have tried to do the above thing, and I found for some reason, the thread only can be excuted once after it is created. Thanks very much for your help.
4
349
by: Jeff | last post by:
I have a program that watches folders for any modifications and then writees to the Event Log. Problem is , is that it writes it four (4) times. I will post the code below and hopefully somone can point out the error that I can't see. Thanks for any help. ---- Code Below -----
12
4143
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. However in vb.net you get continual messages (even setting the system modal property). Firstly, are these two assumptions right and if so what is the approved
3
3942
by: hazz | last post by:
Why do I get this error for this simple console app. It is complaining about the 'timer1_Elapsed' argument in System.Timers.ElapsedEventHandler(timer1_Elapsed); An object reference is required for the nonstatic field, method, or property 'TestTimerIntervalFromConfig.Class1.timer1_Elapsed(object, System.Timers.ElapsedEventArgs)' using System;
1
1631
by: ollyculverhouse | last post by:
Hi, I have a custom menubar which lets users jump to useful forms in my database. For example if I first open a form called 'Add Individual' then another called 'Add Firm', if i try opening 'Add Individual' again nothing happens. (All form openings were from the menubar) I assume this is because the form is already open and so cant open another copy of it. As the menubar lets users follow a different
4
2815
by: Bails | last post by:
Hi Im an absolute beginner in programming and am using VB.Net Express. To start my larning I decided to do a "Real World" app instead of "hello world" and am creating a Poker Countdown clock. I pretty much have most things under control and have set it up as follows: Form 1 Contains a DataGridView where users enter in information includeing the length of each round, small blind & big blind (its for
7
502
by: Andrew Wan | last post by:
I found this excellent High Speed Timer (in Pascal). I compiled it (using Turbo Pascal 7 and it runs fine): http://www.sorucevap.com/bilisimteknolojisi/programcilik/pascal/ders.asp?207995 and same High Speed Timer here too: http://groups.google.com/group/comp.lang.pascal/browse_thread/thread/92e9398f16c10ba4/e67ff3cf587648ef?lnk=st&q=inline(%24CD)+inline(%241C)+inline(%249C)&rnum=1&hl=en#e67ff3cf587648ef I converted it to C (using p2c),...
9
2191
by: brendan_gallagher_2001 | last post by:
Hi I am seeing some strange behaviour on a windows (vb.net 1.1) service. Basically, what I see happening is that when the Timer1_Elapsed event fires, it attempts to execute Timer1.Stop() but takes a long time to do this. In the meantime, the Timer1_Elapsed event fires again and a new thread seems to try and also tries to execute Timer1.Stop(). Eventually, both threads manage to execute Timer1.Stop() and both threads execute the...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.