How to change column border color (to red) in DataWindow?
How to change column border color (to red) in DataWindow?
Hi Kirankumar;
As you can see from the various replies to your question ... the DWO column or the Modify() command does not support what you need. I would suggest opening a Support Ticket as an enhancement request to the DWO property and Modify command, as follows:
1) Add a "Border Color" property to DWO's
2) Add "expression" support for this new property
3) Support the Modify command as follows ...
For example: <DC>.Modify ( "<Columnname>.BorderColor=' <rgb value> ' ")
Food for thought
Regards ... Chris
How to create/destroy a rectangle inside a DW to border a specific object inside that DW
// ---- FUNCTION of_RemoveWarningBox(datawindow adw, string as_name)
// Removes named warning-box
string ls_status
ls_status = adw.Modify('destroy ' + as_name)
if ls_status <> "" then return -1 // Error occurred
return 1
NOTE: You have to convert back and forth PBU <=> pixels to adjust coordinates correctly.
Create function has option to display rectangle only in specific row unless you call using row = 0.
// ---- FUNCTION of_CreateWarningBox( datawindow adw, dwobject dwo, long row, string as_name )
// Creates warning-box around <dwo, row>. Box identified by <name>.
// NOTE: Expect measured in PBUs
constant long BoxColor = 192 // Less "glossy" than 255
long boxX, boxY, boxW, boxH
string ls_status, ls_object, ls_visible
// Calculate property values
// VISIBLE: Only visible in row - unless row=0
if (row = 0) then
ls_visible = "1"
else
ls_visible = "1~tif( GetRow( ) = " + string(row) + ", 1, 0)"
end if
// X, Y: (-1 px) -- Width, Height: (+3 px)
boxX = PixelsToUnits( (UnitsToPixels( long(dwo.X), XUnitsToPixels!) - 1), XPixelsToUnits!)
boxY = PixelsToUnits( (UnitsToPixels( long(dwo.Y), YUnitsToPixels!) - 1), YPixelsToUnits!)
boxW = PixelsToUnits( (UnitsToPixels( long(dwo.Width), XUnitsToPixels!) + 3), XPixelsToUnits!)
boxH = PixelsToUnits( (UnitsToPixels( long(dwo.Height), YUnitsToPixels!) + 3), YPixelsToUnits!)
// Define box syntax
ls_object = 'rectangle(name=' + as_name
ls_object += ' band=' + dwo.Band
ls_object += ' pen.color="' + string(BoxColor) + '"'
ls_object += ' visible="' + ls_visible + '"'
ls_object += ' x="' + string(boxX) + '"'
ls_object += ' y="' + string(boxY) + '"'
ls_object += ' width="' + string(boxW) + '"'
ls_object += ' height="' + string(boxH) + '"'
ls_object += ' brush.hatch="7" pen.style="0" pen.width="1" background.mode="2" )'
ls_status = adw.Modify('create ' + ls_object)
if ls_status <> "" then return -1 // Error occurred
return 1
HTH /Michael
René is right. UI Themes to change - or display rectangle "on top".
Alternative is use background of the control.
I have used that quite successfully many times.
NOTE on Rectangle
If your edit control has 3D Lowered or 3D Raised border that border displays partially "outside" the control! Example of position + size both in pixels not PBUs:
If you rectangle is identical position + size it will look like drawn inside the control; not on top of border.
HTH /Michael
The only way I know are Themes.