473,799 Members | 3,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

8 New Member
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 7418
Delerna
1,134 Recognized Expert Top Contributor
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 Recognized Expert Top Contributor
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....anyon e?
Feb 21 '08 #3
mshmyob
904 Recognized Expert Contributor
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 Recognized Expert Specialist
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 Recognized Expert Contributor
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 Recognized Expert Contributor
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
emlimeng
8 New Member
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
1732
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. When a call is queued, I wish to make that Agent's Table row, flash.
2
6055
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 know how do do this? The only one's i've found animate the title text, which isn't what i'm going for. Thanks :)
7
8989
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 then change the label in front of the textbox or dropdown list to red... is this possible with asp.net? It seems you can only put a RequiredFieldValidator on the page, and if it fails validation then that text is displayed... ? Thanks
6
6938
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 about a LiteralControl and a Label? Other than the lack of being able to format the Literal control's text, I don't see much of a difference in the documentation. TIA, --
4
1486
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 background colour of the form is still set to "control" colour. If I use the background transparent setting instead of seeing my drawn on background and it's gradient i see the forms background colour. If the label was on a solid coloured bit of...
1
1420
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 label background to 'transparant' thanks in advance
2
7603
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 code so it flashes the label red -->white --> red --> white so it simply flash'es the code. my code is MsgBox("flashing --> start") 'test1 lblSnK.ForeColor = Color.Red System.Threading.Thread.Sleep(10000) 'pauses...
2
7344
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 expecting an integer. K.
4
1934
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" title="2008" href="../announcementList.do?year=2008"> 2008
0
9541
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
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10228
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
10027
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...
1
7565
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...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
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
3
2938
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.