Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Como ajustar as colunas de um GRID ?
Message
From
14/08/2002 03:52:58
 
 
To
13/08/2002 18:58:14
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00689370
Message ID:
00689447
Views:
20
> Alguem sabe como fazer o GRID ajustar o tamanho das colunas de acordo com o tamanho dos campos independentemente fonte e seu tamanho ?

Esta query talvez possa ser-lhe útil:
WITH THISFORM.Grid1.Column1
  m.lcFontName = .FontName
  m.lnFontSize = .FontSize
  m.lcFontStyle = IIF(.FontBold,"B","") + IIF(.FontItalic,"I","")
  IF EMPTY(m.lcFontStyle)
    m.lcFontStyle = "N"
  ENDIF
  m.lnAverageWidth = FONTMETRIC(6,m.lcFontName,m.lnFontSize,m.lcFontStyle)
ENDWITH

SELECT MAX(TXTWIDTH(ALLTRIM(Tabela.Campo),m.lcFontName,m.lnFontSize,m.lcFontStyle)*m.lnAverageWidth) ;
FROM Tabela
É devolvida a dimensão máxima, em pixels, do campo.
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform