V4RB, how to create StaticText in code

Tim Davis timdavis at amug.org
Wed May 26 18:40:29 CDT 2004


> Yes, I want
>
>     to have empty window "Properties"
>     or with one pair of static text
>
> Then add as many as I need.
>
>
>     StaticText      StaticText
>
>     ........        ...........
>
>     ........        ...........
>
>
> So I need clone it?

Hi Ruslan,

Here is a working example (based upon Charles and Karen's replies).
Instead of two StaticText fields, I used to one as EditField to 
demonstrate the visibility aspect that may be important.

Tim


   dim NewStaticText as StaticText
   dim NewEditField as EditField
   dim i as Integer

   // place controls in window named StaticText and EditField1,
   // each with index of 0, and visibility of false
   // (if visibility is true, then it must be used, or placed out of 
view)

   for i = 1 to 3
     NewStaticText = New StaticText1
     NewStaticText.Top = 20 + (i * 30)
     NewStaticText.left = 20
     NewStaticText.text = "text " + str(i)
     NewStaticText.Visible = True

     NewEditField = New EditField1
     NewEditField.Top = 20 + (i * 30)
     NewEditField.left = 120
     NewEditField.text = "text " + str(i)
     NewEditField.Visible = True
   next



More information about the Valentina mailing list