S
stocki
Hi,
on a windows form (client site, using C#) I placed an OWC spreadsheet
(axsprPlanung) control. I was asked to highlight some cells in
different colors and to draw a border around them, which is not a
problem meanwhile:
// setting the backcolor
object backColor = "Red" ;
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row, col]).Interior.set_Color( ref backColor ) ;
// drawing a border
object BorderColorBooked = "Black";
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row,
col]).BorderAround(OWC.XlLineStyle.xlContinuous,
OWC.XlBorderWeight.xlHairline, OWC.XlColorIndex.xlColorIndexAutomatic,
BorderColorBooked );
What causes me a headache is to get the highlighted cell back to it's
origin state. The backcolor can be set to white. But how do I reset
the border?
If I use the following, my whole spreadsheet turns black:
object missing = Missing.Value ;
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row, col]).BorderAround(missing,
OWC.XlBorderWeight.xlHairline, OWC.XlColorIndex.xlColorIndexNone,
missing );
The following comes near, but is not the origin:
object BorderColorBooked = "Lightgrey";
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row,
col]).BorderAround(OWC.XlLineStyle.xlContinuous,
OWC.XlBorderWeight.xlHairline, OWC.XlColorIndex.xlColorIndexAutomatic,
BorderColorBooked );
Any ideas are highly appreciated!
Regards
Stocki
on a windows form (client site, using C#) I placed an OWC spreadsheet
(axsprPlanung) control. I was asked to highlight some cells in
different colors and to draw a border around them, which is not a
problem meanwhile:
// setting the backcolor
object backColor = "Red" ;
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row, col]).Interior.set_Color( ref backColor ) ;
// drawing a border
object BorderColorBooked = "Black";
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row,
col]).BorderAround(OWC.XlLineStyle.xlContinuous,
OWC.XlBorderWeight.xlHairline, OWC.XlColorIndex.xlColorIndexAutomatic,
BorderColorBooked );
What causes me a headache is to get the highlighted cell back to it's
origin state. The backcolor can be set to white. But how do I reset
the border?
If I use the following, my whole spreadsheet turns black:
object missing = Missing.Value ;
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row, col]).BorderAround(missing,
OWC.XlBorderWeight.xlHairline, OWC.XlColorIndex.xlColorIndexNone,
missing );
The following comes near, but is not the origin:
object BorderColorBooked = "Lightgrey";
axsprPlanung.get_Range( axsprPlanung.Cells[row, col],
axsprPlanung.Cells[row,
col]).BorderAround(OWC.XlLineStyle.xlContinuous,
OWC.XlBorderWeight.xlHairline, OWC.XlColorIndex.xlColorIndexAutomatic,
BorderColorBooked );
Any ideas are highly appreciated!
Regards
Stocki