473,382 Members | 1,786 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,382 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 1443
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.