Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Too Many Controls on Form
Message
 
 
À
22/06/2011 16:40:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01515563
Message ID:
01515584
Vues:
51
>>>I've created a form on which I need (want????) to put a line with a number of tick marks on it. For the sake of arguement, the tick marks are spaced six units apart. The number is variable and depends upon some data used by the form.
>>>
>>>What I've done is create a large number of line controls, each one representing one of the tick marks. I now have far too many of these controls on the form and it is slowing down the form instantiation and closing.
>>>
>>>I need an alternate approach and am hoping for suggestions. Please make them simple enough that my evil-twin Skippy can't mess it up for me.
>>>
>>>Thanks to all..............Rich
>>
>>May be instead of placing an object you can draw a point directly on the form?
>
>Could you expand on this a bit? For the line with tick marks I'm doing
>
>** Create the line
>thisform.AddObject("objname","line")
>WITH EVALUATE("thisform.objname")
>     .Top = t
>     .Left = l
>     .height = 0
>     .width = w 
>     .visible = .T.
>ENDWITH
>
>** Create all the tick marks
>SELECT ticks
>SCAN
>     thisform.AddObject('lineTick'+PADL(RECNO(),3,'0'),"line")
>     WITH EVALUATE("thisform.lineTick"+PADL(RECNO(),3,'0'))
>          .Left = 83 + (RECNO()*6)
>          .Top = lnTop - 5
>          .height = 10
>          .width = 0
>          .visible = .T.
>     ENDWITH
>ENDSCAN
>
>How would I "draw the line" directly on the screen progamatically?
>
>Thanks......


I personally never had a need to draw objects on the form before, but you can definitely do it using Draw and Point methods of the form and also using GDI+ library. I let someone who worked with drawing objects on the form chime in.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform