ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Dimentionnement dynamique   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

jeu. 12 mars 2015, 20h15

Luc
France France

atoutfox.public.association

Re: Dimentionnement dynamique

Je ne reproduis pas le problème :

Local loForm As Form
Create Cursor curTest (iId I, cNom C(50))

m.loForm = CreateObject("Form")
m.loForm.AddObject("grd", "Grid")
With m.loForm.grd As Grid
  .Visible = .T.
  .Width = m.loForm.Width
  .RecordSource = "curTest"
Endwith
AjusteGrille(m.loForm.grd)

m.loForm.Show()

Wait Window "Ajouter une ligne"
Insert Into curTest Values (1, "Un")
AjusteGrille(m.loForm.grd)

Wait Window "Ajouter une ligne"
Insert Into curTest Values (2, "Deux")
AjusteGrille(m.loForm.grd)

Wait Window "Ajouter une ligne"
Insert Into curTest Values (3, "Trois")
AjusteGrille(m.loForm.grd)

Wait Window "Ajouter une ligne"
Insert Into curTest Values (4, "Quatre")
AjusteGrille(m.loForm.grd)

Wait Window "Fermer la fenêtre"

* -----------------------------------------------------------------------------------------------------------------------------------------------------------
Function AjusteGrille
  Lparameters poGrd as Grid

  * Se placer en haut du curseur
  Go Top In curTest

  * Rafraichir la grille
  m.poGrd.Refresh

  * Ajuster la taille de la grille
  m.poGrd.Height = m.poGrd.HeaderHeight + 18 ;  && Hauteur du scrollBar horizontal
           + Min(Reccount(m.poGrd.RecordSource), m.poGrd.Parent.Height) * m.poGrd.RowHeight
EndFunc


Luc

Permalink : http://www.atoutfox.org/nntp.asp?ID=0000016094
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3