Gaoming_Fu
asked on
How to set the background of current active cell of MSFlexGrid control??
Hi All:
I want to set the background color of any cell users clicked so that users feel any cells they clicked are highlighted, i.e., if users click cell of row 1 and col 1, this cell will be highlighted, then if users click cell of row 2 and col 2, this cell will be highlighted too, however, the cell of row 1 and col 1 must not be highlighted. Any time only the current active cell will have the background color that is different from all other cells.
Any help will be highly appreciated.
I want to set the background color of any cell users clicked so that users feel any cells they clicked are highlighted, i.e., if users click cell of row 1 and col 1, this cell will be highlighted, then if users click cell of row 2 and col 2, this cell will be highlighted too, however, the cell of row 1 and col 1 must not be highlighted. Any time only the current active cell will have the background color that is different from all other cells.
Any help will be highly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi twalgrave:
It worked, thanks a lot.
icredes, thanks a lot for for your comments too. I am using VBScript.
It worked, thanks a lot.
icredes, thanks a lot for for your comments too. I am using VBScript.
<style>
TD.red {
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial,Helvetica; BACKGROUND-COLOR: #ff0000
}
TD.blue {
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial,Helvetica; BACKGROUND-COLOR: #0000ff
}
</style>
<script language="javascript">
function go(obj)
{
obj.className="blue";
}
</script>
<TABLE>
<TR>
<TD class=red onclick="go(this)">One</TD
<TD class=red onclick="go(this)">Two</TD
<TD class=red onclick="go(this)">Buckle My Shoe</TD>
</TR>
<TR>
<TD class=red onclick="go(this)">Three </TD>
<TD class=red onclick="go(this)">Four </TD>
<TD class=red onclick="go(this)">Shut the Door</TD>
</TR>
<TR>
<TD class=red onclick="go(this)">Five </TD>
<TD class=red onclick="go(this)">Six</TD
<TD class=red onclick="go(this)">Pick up Stix</TD>
</TR>
<TR>
<TD class=red onclick="go(this)">Seven </TD>
<TD class=red onclick="go(this)">Eight</
<TD class=red onclick="go(this)">Stay UP Late</TD>
</TR>
<TR>
<TD class=red onclick="go(this)">Nine </TD>
<TD class=red onclick="go(this)">Ten </TD>
<TD class=red onclick="go(this)">Do it all again</TD>
</TR>
</TABLE>