> Anyone know how to draw HMTL style borders, such as ridge
and groove, on a VB.NET control.
I want to be able to draw borders of various styles, colours
and sizes on a picture box or similar control.
I have a great routine for painting borders of several styles, but
unfortunately I haven't translated it to .NET yet--it's in VB6. But I can
post it if you want it.
Basically it's just a matter of lines of two or four colors. Windows assumes
a light source from the upper right corner of the screen. To draw a sunken
box, use dark colors on the top and left of the box, and light colors on the
bottom and right. The light source doesn't "shine" on the upper-left side,
which is not facing it, but does hit the lower-right side, which is facing
it. A raised box would be the opposite. A grooved border can be achieved
with a dark line on the outside top/left, a light line on the inside
top/left, a dark line on the inside bottom/right, a light line on the
outside bottom/right. And so on.
You can see how it's done by looking closely at any window. Even take a
screenshot (Ctrl-PrintScrn) and paste it into Paint, and zoom in to see it
clearly. There are system color constants defined for each shade of
shadowing/highlighting you need.
Brian
--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Building better tools for developers - Be part of it!