BorderColor, BorderStyle, BorderWidth
These properties control the borders of objects that have changeable borders. But some of the results are pretty strange.
Usage |
oObject.BorderColor = nColor nColor = oObject.BorderColor oObject.BorderStyle = nStyle nStyle = oObject.BorderStyle oObject.BorderWidth = nWidth nWidth = oObject.BorderWidth |
In VFP 5 and later, with low color resolution (such as 256 colors), when a line or shape has a BorderWidth of 1, certain BorderColors show up wrong. The problem seems to occur with colors where the RGB values are some permutation of 0, 128, and 255. The same problem also occurs when BorderWidth of a line is greater than 1 and BorderStyle is set to 2, 3, 4 or 5. |
Example |
* Make a very un-Windows kind of form - maybe for an alert. * Assume we have a reference, oForm, to the form. oForm.BorderStyle=1 oForm.Closable=.F. oForm.ControlBox=.F. oForm.MaxButton=.F. oForm.MinButton=.F. oForm.Movable=.F. oForm.Caption="" * Border stuff is fun with lines and shapes. * First, create a form. oForm=CREATEOBJECT("Form") oForm.Show() oForm.AddObject("CoolLine","Line") oForm.CoolLine.Visible=.T. oForm.CoolLine.Left=25 oForm.CoolLine.Top=25 oForm.CoolLine.Width=100 oForm.CoolLine.Height=150 oForm.CoolLine.BorderColor=GETCOLOR() && Choose your favorite oForm.CoolLine.BorderWidth=10 oForm.AddObject("DottyLine","Line") oForm.DottyLine.Visible=.T. oForm.DottyLine.Left=150 oForm.DottyLine.Top=40 oForm.DottyLine.Width=40 oForm.DottyLine.Height=25 oForm.DottyLine.BorderColor=GETCOLOR() && Choose your favorite oForm.DottyLine.BorderStyle=5 oForm.DottyLine.LineSlant="/" oForm.AddObject("CoolShape","Shape") oForm.CoolShape.Visible=.T. oForm.CoolShape.Left=25 oForm.CoolShape.Top=100 oForm.CoolShape.Width=60 oForm.CoolShape.Height=50 oForm.CoolShape.BorderColor=GETCOLOR() && Choose your favorite oForm.CoolShape.BorderWidth=5 |
See Also |
BackColor, DrawStyle, DrawWidth, FillColor, FillStyle, ForeColor, SpecialEffect, TitleBar |