473,394 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

run code on background

Hello

I have a program for which I want to see from a distance if it has been
started.
I made a timer which is enabled when the program is started.
Code in the timer:
Label_Again:

txtWaitRun.Text = "R"
Threading.Thread.Sleep(300)
txtWaitRun.Text = "Ru"
Threading.Thread.Sleep(300)
txtWaitRun.Text = "Run"
Threading.Thread.Sleep(300)
txtWaitRun.Text = "Runn"
Threading.Thread.Sleep(300)
txtWaitRun.Text = "Runni"
Threading.Thread.Sleep(300)
txtWaitRun.Text = "Runnin"
Threading.Thread.Sleep(300)
txtWaitRun.Text = "Running"
Threading.Thread.Sleep(300)

GoTo Label_Again

When this timer starts:
1: I do not see the text of txtWaitRun change
2: The rest of the program doesn't start ofcourse because the timer is
never ready.

How can I run this code permanently on the background?
Why doesn't the text change?

Best regards, Jurgen
Jul 21 '05 #1
4 1446
Hi Jurgen,

Not the nicest code with that goto (but it is for testing I asume), however
your problem is that when a method is run it has no contact with the UI, to
try that you can set after every wait a me.refresh (Do not set it in your
production version it is not for nothing that it is not done forever)

I hope this helps?

Cor
Jul 21 '05 #2
Hello Cor,

The refresh I found out already and that helps. But the problem is that the
loop is never completed so the program will not continu with the rest of the
code after the timer.

Jurgen

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Hi Jurgen,

Not the nicest code with that goto (but it is for testing I asume), however your problem is that when a method is run it has no contact with the UI, to try that you can set after every wait a me.refresh (Do not set it in your
production version it is not for nothing that it is not done forever)

I hope this helps?

Cor

Jul 21 '05 #3
Look into using threads, that way you can run your code and allow the main
application to run.

HTH
John

"Jurgen Oerlemans" <ju**************@envirolab.no_spam.nl> wrote in message
news:40*********************@news.wanadoo.nl...
Hello Cor,

The refresh I found out already and that helps. But the problem is that
the
loop is never completed so the program will not continu with the rest of
the
code after the timer.

Jurgen

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Hi Jurgen,

Not the nicest code with that goto (but it is for testing I asume),

however
your problem is that when a method is run it has no contact with the UI,

to
try that you can set after every wait a me.refresh (Do not set it in your
production version it is not for nothing that it is not done forever)

I hope this helps?

Cor


Jul 21 '05 #4
Hi Jurgen,

There are 4 timers, are you using the
system.timers.timer
for this most people start with taking the
system.forms.form.timer

And than not using that crazy loop, only when it is firing you can use that.
And before somebody starts to point me on that have a look at multithreading
for this, however make it first working with a
\\\
applications.doevents as well in your code.
///

I think that it is better that you switch to the newsgroup

microsoft.public.dotnet.languages.vb

(There are more persons than in this newsgroup who answers VBNet language
questions)

Cor
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Vinod | last post by:
Hi, I have got a peculiar requirement. I want to distinquish between the color codes. I have got two text fields and i will enter the color codes there. The first text field will have ...
33
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show...
3
by: moondaddy | last post by:
I have some text in a page that when a certain even happens, I need to make it glow from black to red (through a spand of 1 second) pause for a few seconds, and then slowly change from red to black...
11
by: Tim Marshall | last post by:
I use Terry Kreft's & Stephen Lebans colour dialog procedures for users to pick colours for various control properties in certain apps. Is there a way to take the colour code that is displayed in...
12
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in...
1
by: laurakr | last post by:
I am trying to use a clear to get my bottom nav bar below the quote box on the right, but it isn't working. I would like the bottom edge of the quote box to "stick" to the footer nav bar but copy...
1
by: cnixuser | last post by:
Hello, I am having a problem that I believe is related to the way a stream reader object looks for a text file by default. What I am doing is using a StreamReader object to read the text of a text...
7
by: praveenb000 | last post by:
Hi, every one on this forum.... I am new to web designing (using HTML/CSS). i designed a web page using HTML, Css with dream weaver. Here is the code i used for the desinging. it appears well...
2
by: sateeshchandrasanga | last post by:
Hi All, My HTML code is working fine in Firefox.But its not displaying any thing in IE.Can you help me in this problem.And in Google crown its displaying but not properly. ...
2
by: everly | last post by:
Hi, I'm helping my friends band and making their MySpace. I messed something up and I can't figure out what it is. Everything is all out of whack on the bottom half of the page. The comments...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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...

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.