Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form - resize rubber band
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00944495
Message ID:
00947166
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform