Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Centering an image in a form, regardless of form size
Message
De
16/03/2005 11:33:31
 
 
À
16/03/2005 08:34:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00996271
Message ID:
00996377
Vues:
41
Here is what I used to make it work in vfp9.
PUBLIC oHandler, cScreen
oHandler=NEWOBJECT("myhandler")
_SCREEN.AddObject("MyScreen1","MyScreen")
BINDEVENT(_SCREEN,"Resize",oHandler,"myresize")

DEFINE CLASS MyScreen AS Custom
   cScreen = _SCREEN

   PROCEDURE Init
       this.cScreen = _SCREEN
       this.cScreen.AddObject("Image1","Image")
       WITH this.cScreen.Image1
*!* This commented out will use default size of picture
*!*	           .Height = 400
*!*	           .Width  = 800
           .Stretch = 2
           .Picture = "MyImage.jpg"
           .Visible = .t.
           .Left = INT((this.cScreen.Width  - .Width)/2)
           .Top  = INT((this.cScreen.Height - .Height)/2)
       ENDWITH
   ENDPROC
ENDDEFINE

DEFINE CLASS myhandler AS Session
   cScreen = _SCREEN

   PROCEDURE myresize
       this.cScreen = _SCREEN
       WITH this.cScreen.Image1
           .Left = INT((this.cScreen.Width  - .Width)/2)
           .Top  = INT((this.cScreen.Height - .Height)/2)
       ENDWITH
   ENDPROC

ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform