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

Colour change OnClick

Is it possible to have a button change colour OnClick ?

Thanks.
Nov 13 '05 #1
2 6577
Di
Scott wrote:
Is it possible to have a button change colour OnClick ?

Thanks.


Hi Scott,
Buttons do not have the background colour property so you can't
change their colour (pity). What I have used in the past is boxes, they
have an OnClick event that you can use to simulate a command button.

They however do not have a tab stop property so you may not be able to
bring them into focus without directly clicking on them. You can use
them in conjunction with the command button and use the visible
property to alternate between them.

Good Luck,
D...

Nov 13 '05 #2
The OP can change the color of the CommandButton control during the
Click event. THe simplest method is to have a hidden CommandButton
control containing a single color Bitmap. During the Click event you
could use code like:

Me.TheNameofTheCurrentCommandButton.PictureData =
Me.TheNameOftheHiddenCommandButton.PictureData

A solution to allow you to specify the BackGround color of
COmmandButtons is here:
http://www.lebans.com/cmdbutton.htm
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Di" <di************@bpb-na.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Scott wrote:
Is it possible to have a button change colour OnClick ?

Thanks.
Hi Scott,
Buttons do not have the background colour property so you can't
change their colour (pity). What I have used in the past is boxes,

they have an OnClick event that you can use to simulate a command button.

They however do not have a tab stop property so you may not be able to
bring them into focus without directly clicking on them. You can use
them in conjunction with the command button and use the visible
property to alternate between them.

Good Luck,
D...


Nov 13 '05 #3

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

Similar topics

1
by: John D | last post by:
I am trying to change the background colour of either a div or a textarea with javascript, but am having problems. I have passed a hex colour value in the variable hval, and with the following...
3
by: NeoPhreak | last post by:
I am creating a menu for my site and I would like it so that when the onMouseOut even is triggered it will cause the cell of the table to fade out back to the normal color with a delay. Can...
1
by: Alistair Birch | last post by:
Hi I want rows of a table to appear in alternating background colours. Having looked around the web I can't find any solution apart from waiting for the next version of CSS, so I tried building...
6
by: Louise | last post by:
Hi I have written an HTML pages which does not have any colour specifying tags as far I know. When I view this in an Microsoft internet explorer browser it appears with a white background and...
1
by: ms | last post by:
Hi, I've been trying to find a way to change a cell's colour when clicking it. What I've found so far is to change the background colour by using: function whenClick(navElm) { var state1 =...
6
by: Lapchien | last post by:
One of my users has asked that a form change it's colour if a particular yes/no box is ticked - possibly made a bit more tricky because the form is tabular..? Thanks, Lap
0
by: llarryllama | last post by:
I'm using this script (see below) that I found here on thescripts and it's working perfectly. It's to change text color of a "visited link" back to unvisited color. The problem is that to make the...
10
by: Pulzar | last post by:
Hi there, I want to show a simple image on a web page, and allow the viewer to select and change one of the colours used in the image, and immediately preview the result. I'd like to keep the...
7
by: Tristán White | last post by:
Hi there, this'll be an easy one I'm sure. I have a small question that will take a second to answer, I am sure. If you go to http://snipurl.com/t821 All the buttons on the left are red, and...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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
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...
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.