[AccessD] Changing colors on many controls on one Form

JWColby jwcolby at colbyconsulting.com
Tue Jan 9 05:42:14 CST 2007


LOL, yep, a control class and a form class that has a scanner.  The scanner
loads an instance of the control class for each control of a given type
(text box, combo etc).  The control class sinks the focus events and changes
the colors.  In fact I have a demo of the concept on my web site.

Goto www.colbyconsulting.com

Register if you have not already done so.

Click Example Code / Withevents Demo
Click BackColorWithevents.zip.


Then read up a bit.

Click ExampleCode C2DbFW3G Articles.
Select Supervisors in the menu to the left.  That will give you a simple
form class with the control scanner.
Next select Control classes to see how to hook up control classes to the
form class.

You would then want a SysVars class to store the back color along with any
other application variables.

Click ExampleCode C2DbFW3G Articles.
Select System Variables (sysvar) from the menu on the left side of the page.

And you are on your way to a framework where other things of the kind of
thing you are discussing can be added easily and quickly in the future.

This stuff is not rocket science.  If you can program events in your form
you can understand and use this stuff.  Once you do you will wonder how you
ever got along without it.

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Johncliviger at aol.com
Sent: Tuesday, January 09, 2007 5:58 AM
To: accessD at databaseadvisors.com
Subject: [AccessD] Changing colors on many controls on one Form

Good morning all
 
I've just been asked by a user if the backcolor can be changed when that
control has got focus and changes back to original when it looses focus.
Yeah thats OK I can handle that no problems. But with 30+ controls going to
each control and adding one line of code to change the backcolor and change
it back on each got and lost focus property is a pain. And next week the
user will ask "can we have a different color".
 
This job labour intensive so is there a more elegant approach to this
simple but boring job??
 
TIA
 
johnc
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list