Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form - resize rubber band
Message
From
29/09/2004 10:08:27
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00944495
Message ID:
00947166
Views:
24
Frank,

>I'm just doing a minor update that respects MinWidth and MinHeight and allows AutoSize to scrollbar's height and width

Yes, minimum Width & Height is an important point.

Looking from your class, you mentioned about this:
*-- hPatBrush   = this.CreateBrush()
*-- hmmm.... not working. let's keep it the way
*-- it was: the brush gets created and deleted()
*-- everytime this method is called
Let's make it work. CreateBrush() method doesn't have to returned the value because you already put the handle into hBrush property. So, call the CreateBrush() method from Init / MouseDown.

Then in PatternedRubber()
** change this line
hOldBrush	= SelectObject( hDC, hPatBrush )

** with this
hOldBrush = SelectObject( hDC, This.hBrush )
Then call the DestroyBrush() on Destroy / MouseUp.


For the RubberBand, make the pen style thicker than default.
#Define PS_SOLID        0
#Define PS_INSIDEFRAME  6
#Define COLORREF        Long

** Create the pen
Declare HANDLE CreatePen in GDI32 ;
    Integer fnPenStyle, Integer nWidth, COLORREF crColor

hPen = CreatePen( PS_SOLID + PS_INSIDEFRAME, SysMetric(3), RGB(0,0,0) )

** On draw
hOldPen = SelectObject( hDC, hPen )

** On destroy
DeleteObject( hPen )
BTW, the dotted corner looks very nice :-)
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform