Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dotted-border Box
Message
De
20/04/2009 19:30:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01395217
Message ID:
01395691
Vues:
50
The Line method was inflexible and appeared to have trouble with single pixels
(perhaps it was just me screwing it up).

FWIW, I ended up doing the following:
(1) Subclassed Shape to create PixelShape:
BackColor = 0,0,0
BorderStyle = 0
BorderWidth = 1
Height = 1
Width = 1

(2) Created a collection object on the Page, and
looped (with STEP 2) to fill the collection with
PixelShape objects with Top and Left props set.

Setting Visible .T./.F. now just requires a FOR EACH loop.

In all, much more trouble than it was worth -- but
at least I now have my dotted rectangle!

=====================

>You're welcome.
>
>>
>>Thanks -- it was there staring me in the face all the time. Obviously I hadn't had
>>occasion to use the method before.
>>
>>-mark
>>
>>=======================
>>
>>>Hi Mark,
>>>
>>>For simplicity, the code below assumes that you've transparent shape with transparent borders (Shape1) on the form that defines where a dotted border box should be drawn
>>>
>>>WITH Thisform
>>>	lnPosX = .Shape1.Left
>>>	lnPosY = .Shape1.Top
>>>
>>>	FOR i=1 TO .Shape1.Width STEP 2
>>>		lnPosX1 = lnPosX + i - 1
>>>		lnPosY1 = lnPosY
>>>		.Line(lnPosX1, lnPosY1, lnPosX1+1, lnPosY1)
>>>		lnPosY2 = lnPosY1+.Shape1.Height-1
>>>		.Line(lnPosX1, lnPosY2, lnPosX1+1, lnPosY2)
>>>	ENDFOR
>>>
>>>	FOR i=1 TO .Shape1.Height STEP 2
>>>		lnPosX1 = lnPosX
>>>		lnPosY1 = lnPosY + i - 1
>>>		.Line(lnPosX1, lnPosY1, lnPosX1+1, lnPosY1)
>>>		lnPosX2 = lnPosX1+.Shape1.Width-1
>>>		.Line(lnPosX2, lnPosY1, lnPosX2+1, lnPosY1)
>>>	ENDFOR
>>>ENDWITH
>>>
>>>
>>>
>>>>Is there a Win API to draw a box with a dotted border EXACTLY like
>>>>what surrounds the caption of a clicked checkbox (such as
>>>>when you just clicked this message)?
>>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform