Normal Topic RGBCOLOR() Command (Read 520 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
RGBCOLOR() Command
Aug 18th, 2004 at 1:59pm
Print Post Print Post  
Is there a way of just setting either the background or foreground color only, with RGBCOLOR(). I attempted to leave out digits but RGBCOLOR() seems to want allowed digits only.

The reason I ask is that I have color-coded my text based on the Tab and tab label color. For example everything associated with shipping information tab has blue text. With this setup users do not get confused as to which tab is open on top at the present time. As they click from tab to tab the text color changes for instant notification of what data they are using.

In a number of my Sbasic routines and functions I am testing for a condition and when it is not met I popup a message telling the user and then set the element background color to red and throwfocus to that element. My problem is that when the condition is met after being corrected to set the text color back to the desired color I have to test for the element name and then have specific if statements for every element type (Since my elements naming convention has the type at the beginning of each such as ShipStreet, WorkStreet etc I could verify the type by using something like ThisElement and an @left command to figure out what color it should be to limit the amount of if statements needed) or a simpler method would be for me not to have to mess with the foreground color and only turn the background to red and then back to white.

So that is why I ask.

Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: RGBCOLOR() Command
Reply #1 - Aug 18th, 2004 at 3:17pm
Print Post Print Post  
There is no way to set the background color separately from the foreground color using RGBColor. But you can determine the element type and/or the field type of the element using either @ElementType and @ElementBoundToType. That should allow you to use ThisElement and a single subroutine or function to enable the behavior on any element without relying on the naming. While still having a different color for the text in numbers.

In the meantime, I'll see if I can write a routine that returns the current RGB colors of the foreground/background and see if I can give RGBColor the ability to set either one or the other or both at once. No promises, though.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged