Painting Splitter Bars
Posted on 2001-08-06
How do i paint a splitter bar exactly (or as close as possible) as the VB6 IDE does it?
at the moment my splitter bar code renders like a non filled rectangle... yurrrk amateurish!!
Here is the code i have at the moment... (minus the api decls) the SetROP2 hdc, R2_NOTXORPEN doesnt seem to like the fillrect call... groan...
' Get the Desktop DC:
hdc = CreateDCAsNull("DISPLAY", 0, 0, 0)
' Create a brush
h = CreateHatchBrush(HS_BDIAGONAL, RGB(240, 240, 240))
' Create a pen
p = CreatePen(1, 1, RGB(240, 240, 240))
' load em in
SelectObject hdc, h
SelectObject hdc, p
' Set to XOR drawing mode:
SetROP2 hdc, R2_NOTXORPEN
' do the fill rectangle call (doesnt seem to work
' with R2_NOTXORPEN???)
FillRect hdc, rcCurrent, h
' release the resources.