Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anchor & Adding controls at runtime
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Anchor & Adding controls at runtime
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01036333
Message ID:
01036333
Vues:
52
I have a control I add to a pageframe when the user clicks on that page. I do not know the size of the pageframe because the Anchor property will resize the pageframe. So I add the control and set the height/width based on the pageframe's height/width. This works until the form is resized at which point the control snaps back to its original size and then resizes from there.

Is there a different technique I should be using to add the control and get sized correctly?
PUBLIC x
x = CREATEOBJECT("form")
x.ADDOBJECT("pf1","myPageFrame")
x.pf1.Visible = .T.
x.Show()

DEFINE CLASS myPageFrame AS PageFrame
   MemberClassLibrary = 'myPages.PRG'
   MemberClass = 'myPage'
   ANCHOR = 240
   PageCount = 1
   TOP = 10
   LEFT = 10
   HEIGHT = 200
   WIDTH = 250
ENDDEFINE

DEFINE CLASS myPage AS Page
   
   PROCEDURE CLICK
      this.AddObject("cn","container")
		this.cn.anchor = 240
		this.cn.height = this.Parent.Height-30
		this.cn.width = this.Parent.width -10 
		this.cn.visible = .T.
   ENDPROC
ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform