473,466 Members | 1,331 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Changing colors of buttons on form after set delay

2 New Member
...with a simple problem. I have 2 buttons on my form, button1 and button2. I want the following sequence:-

1) button1 changes colour to red
2) wait 2 seconds
3) button1 changes back to gray and button2 changes to red
4) wait 2 seconds
5) button2 changes back to gray and button1 changes to red.

Please help me or I'll be forced to eat more chocolate orange biscuits.
Feb 9 '08 #1
2 1340
sicarie
4,677 Recognized Expert Moderator Specialist
So what do you have on this? What have you tried?
Feb 10 '08 #2
burtski99
2 New Member
Hey, thanks for your reply - I wasn't expecting one this quick.

I've tried system.threading.thread.sleep (2000).

I also tried a ridiculous "while" statement which took the current datetime seconds value, then populated int1 with it. I populated int2 with int1 + 2 (subject to an 'if' which said that if int1 is > 57, subtract 60 from it) I then had a "while (int1<int2) {int1 = System.DateTime.Now.second}.

Both of them compiled, but I ended up with the final result ie button1 red. Button2 didn't even blink a little bit.
Feb 10 '08 #3

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

Similar topics

7
by: Michel | last post by:
Hi folks, I wonder if what I have in mind is possible, maybe even not all that complicated: I have an image, which is a yellow circle. I want this yellow circle to change color by having 3...
2
by: RIck Measham | last post by:
I have a dynamically generated table, filled from a database by a perl application. Each row represents a database record and has a 'status' and a unique 'id'. What I want to do is create...
5
by: martin | last post by:
I needed a way to display calculated, multiple, changing values (numerical sums) as users interacted with the page, and do this without going back to the server to load the page again. What I...
4
by: Gequina | last post by:
Something goes wrong in my script. I'm all new to it so i don't know much yet. I have a set of buttons. And when you click on either of them, the background image will change. Only it's not...
1
by: Richard | last post by:
All, In my Windows based .NET C# application I tried to change a form's background color to non-gray. The form backround color change had the desired ripple effect for most controls on the...
1
by: Firewalker | last post by:
I am attempting to change the backColor property on the previously instantiated buttons FROM a listbox_doubleClick event. I thought it would be something like this: If...
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...
12
by: Henry Jones | last post by:
I have a VS 2005 VB.NET project and would like to change the color of the textbox when the user hovers over it. In a Module I have the following routines: Public Sub Button_Hover(ByRef btnName...
6
by: ikkeugh | last post by:
Hello , i've got a question : How do you make those mouse over buttons in Visual Basic 6.0 with a delay ? I want them to look like this . The buttons come a few (small)seconds later so they have...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
0
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,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.