473,386 Members | 1,715 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,386 software developers and data experts.

Label Automation (Flashing): changing a label's colour

Hello, I have a label on the form to draw people's attention so they do not forget to input the data in a particular section. e.g. "Please carefully check all the options on the form".

I hope I can automate the colour of the label, so that the colours for the label can keep on changing nicely and smoothly from one end to the other. Such as the colours moves per letter or per word from left to right towards the end of the sentence, or from a corner to the other.

Is this a complecated process? Should I use array or timer? I am not sure if I am on the right track and which functions or properties I need to use in order to complete this process, could anyone please point it out for me? Thanks in advance for any suggestions.

Cheers

meng
Feb 21 '08 #1
7 7373
Delerna
1,134 Expert 1GB
since you want the colors scrolling through the letters of the message you could try this

Have 1 label for each letter in the message, so that way letter can be a different color.
or
Have 1 label for each word in the message, so each word can be a different color.

Then use the forms timer event to update the colors in a way that the colors scroll the way you want.

For the colors you could use an array to store the sequence of colors.
The label has a tag property which you can store the index into the array for the labels current color.
Each time the timer even fires you increment the number in the tag and then set the labels forecolor to the color pointed to by the index in its tag property.

Have a go at coding that and if you have trouble, post your attempt here and someone will help you.
Feb 21 '08 #2
Delerna
1,134 Expert 1GB
Another posibility would be a sequence of images and using the forms timer event you could change the image in an image control so that the color animation does whatever you want it to do.
There is probably a million and one ways to do this.
Can you make giff animations work in access....anyone?
Feb 21 '08 #3
mshmyob
904 Expert 512MB
Later today I will try and write the code for you. I have written some code to scroll a message through a text box (like a ticker display), so I am sure I can modify it to scroll through colours. I post it if I get it changing colours.

Hello, I have a label on the form to draw people's attention so they do not forget to input the data in a particular section. e.g. "Please carefully check all the options on the form".

I hope I can automate the colour of the label, so that the colours for the label can keep on changing nicely and smoothly from one end to the other. Such as the colours moves per letter or per word from left to right towards the end of the sentence, or from a corner to the other.

Is this a complecated process? Should I use array or timer? I am not sure if I am on the right track and which functions or properties I need to use in order to complete this process, could anyone please point it out for me? Thanks in advance for any suggestions.

Cheers

meng
Feb 21 '08 #4
missinglinq
3,532 Expert 2GB
I have to tell you that having a scrolling , multi-color message crawl across a data entry form is a very bad idea! You're dealing with a database here, not a video game. It will be distracting to your users and very probably cause an increase in data entry errors! Using the Timer Event to do this sort of thing in a splash screen is one thing, but this type of prolonged use of the Timer frequently leads to sluggish response times and other processing problems when data is also involved. You'd be far better off using validation code in your form's BeforeUpdate event to insure that the required data is entered. If you insist on using a flashing label, you'd be better off using one that is less distracting, like one that slowly cycles thru two colors.

This code will do this. Set the Timer Interval to 400. The colors, of course, can be changed to suit you.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.  With Me.FlashingLabel
  3.  'If the color is black, the color is red otherwise the color is black!
  4.  .ForeColor = (IIf(.ForeColor = vbRed, vbBlack, vbRed))
  5. End With
  6. End Sub
  7.  
Welcome to TheScripts!

Linq ;0)>
Feb 21 '08 #5
jaxjagfan
254 Expert 100+
I agree with Missingling's assessment. What I normally do is build my logic into the afterupdate property of each required control. The form appears normal (standard colors) until the end user leaves a control null, incorrect data, or incorrrect format. It's at that moment I change the label color and/or control backcolor along with a message box telling them what they are doing wrong. If the enduser isn't screwing it up, no need to display a "rainbow", keep the interface simple and professional.
Feb 21 '08 #6
mshmyob
904 Expert 512MB
I agree with Linq and Jax but if you really want the scrolling text code I will post it. I did it for a test I was running and it didn't affect the data entry but it was on a table with only about 5000 records and there was not any intence queries being run. It had about 30 fields.

I did notice though that making a control flash or change colours constantly had more of an impact than just changing a text box value.

My own thoughts are that I usually stay away from flashing, changing colours constantly, or scrolling because it is SOOOOOO annoying. The only time I like to use the ONTIMER event is for extended timer events such as backing up each night or checking every hour or so.

A flashing or scrolling event is done anywhere between 200ms to 1 second usually.

After all said and done if you want the scrolling text code I will post it just let me know.

I agree with Missingling's assessment. What I normally do is build my logic into the afterupdate property of each required control. The form appears normal (standard colors) until the end user leaves a control null, incorrect data, or incorrrect format. It's at that moment I change the label color and/or control backcolor along with a message box telling them what they are doing wrong. If the enduser isn't screwing it up, no need to display a "rainbow", keep the interface simple and professional.
Feb 21 '08 #7
Hello, Delerna, mshmyob, missingling, and jaxjagfan, many thanks for all your suggestions and comments.

I have get the visual effect from missingling's code generally, having a flashing label do distract the users. What I am trying to achieve at the moment is the colour could scrolling from one end to other slowly and smoothly, therefore, the users do not feel uncomfortable, it also could draw people’s attention. I will have a go on Delerna's first suggestions and see if I can work out how to scroll the colours by using array, timer and tags.

Cheers for all your helps, I will come back shortly.

regards

meng
Feb 24 '08 #8

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

Similar topics

2
by: rikesh | last post by:
Hi Does anyone know how to make a table row flash in a certain colour, depending on a DB value? I have a helpdesk application listing statuses of Agents and the calls queued on the system. ...
2
by: Phillip Parr | last post by:
I've made a chat page using php and javascript. Which is nice. But I'd really like the title bar to flash when a new message appears for users who have minimised the window, like msn. Does any body...
7
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and...
6
by: Joe | last post by:
I know that the Literal control will not render a <span> tag so I can not format its text. Other than this, what is the difference betwen the Literal control and the LiteralControl Control? How...
4
by: Adam Maltby | last post by:
Hi, I need to do a transparent label but with a difference. I have drawn on my form a custom background using CreateGraphics as I needed an ellipse looking fill in a rectangle - so the actual...
1
by: Peter Newman | last post by:
vb.net 2005 is it possible to set a label's background color to transparant. I have several labels on a form , the form colour is set in a class and is a gradiant colour. Im trying to set the...
2
by: j1808 | last post by:
hi there, so yes, im am trying to make my label flash diffrent colours, so when i have enterd a value in some textbox which does not meet my parameter, (i.e runs the ELSE in an IF..) it runs this...
2
by: kronecker | last post by:
I want to set the custom colour &H0000BDBF& which I got from a colour picker program. I need to set this as the background colour to a Label. I tried Label1.backgroundcolor = etc but it is not...
4
by: sgxbytes | last post by:
Hi, My html has <Table style="year-button-archive" width="60%" > <tr> <td class="gold" > <a title="year">By Year:</a> <td class="gold"> <a id = "2008"...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...

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.