Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Centered texts in a grid
Message
From
17/02/2016 04:08:10
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01631573
Message ID:
01631588
Views:
73
Update: tried several times to upload screenshot, unsuccessfully; here it is on a FTP server: ftp://foxincloud.com/Screenshots/FiC/ipLAN.PNG

Hi Peter,

I seem to get the result you're looking at without knowing exactly how (attached ss)

here are my settings (all properties are default in aw* classes):
DEFINE CLASS ipwgrd AS awgrd
	MemberClassLibrary = ..\..\..\..\..\..\program files\vfp9\tools\ab\awpublic.prg
	MemberClass = "awGrc"
	HighlightBackColor = RGB(183,219,255)
	Name = "ipwgrd"
ENDDEFINE

DEFINE CLASS ipGrc AS awGrc OF awPublic.prg && as Column
	wlContentDynamic = .F. && {en} This object's members and/or properties are dynamic - .F. if neither member nor property change at run-time {fr} Le contenu et/ou les propriétés de cet objet sont dynamiques - .F. si ni les membres ni les propriétés ne changent à l'exécution
ENDDEFINE

DEFINE CLASS ipwtxt AS awtxt
	FontName = "Calibri"
	Format = "K"
	DisabledBackColor = RGB(228,228,228)
	BorderColor = RGB(192,192,192)
	wchtml5type = "text"
	Name = "ipwtxt"
ENDDEFINE

	ADD OBJECT grd AS ipwgrd WITH ;
		ColumnCount = 16, ;
		FontName = "Tahoma", ;
		FontSize = 8, ;
		Anchor = 15, ;
		AllowHeaderSizing = .F., ;
		AllowRowSizing = .F., ;
		DeleteMark = .F., ;
		GridLines = 1, ;
		HeaderHeight = 17, ;
		Height = 342, ;
		Left = 0, ;
		RecordMark = .F., ;
		RecordSource = "WebTemp_Page", ;
		RowHeight = 31, ;
		TabIndex = 16, ;
		Top = 150, ;
		Width = 1206, ;
		ForeColor = RGB(153,153,153), ;
		GridLineColor = RGB(192,192,192), ;
		HighlightStyle = 2, ;
		ZOrderSet = 5, ;
		AllowAutoColumnFit = 2, ;
		Optimize = .T., ;

...

		Awgrc3.FontName = "Tahoma", ;
		Awgrc3.FontSize = 8, ;
		Awgrc3.ColumnOrder = 5, ;
		Awgrc3.ControlSource = "WebTemp_Page.invoice", ;
		Awgrc3.Width = 96, ;
		Awgrc3.ReadOnly = .T., ;
		Awgrc3.DynamicForeColor = "iif(webtemp_page.priority, rgb(255,0,0), rgb(51,51,51))", ;
		Awgrc3.ForeColor = RGB(51,51,51), ;
		Awgrc3.Wcssclassadd = "hover", ;
		Awgrc3.Name = "grcInvoice", ;


	ADD OBJECT ip.grd.grcinvoice.txt AS ipwtxt WITH ;
		FontName = "Tahoma", ;
		FontSize = 8, ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		Margin = 0, ;
		MousePointer = 15, ;
		ReadOnly = .T., ;
		ToolTipText = "Click on Invoice Number for details", ;
		ForeColor = RGB(51,51,51), ;
		BackColor = RGB(255,255,255), ;
		Name = "txt"
>Hi All,
>
>I have a grid with several columns and textboxes within. The columns have Alignment=2 (middle center) and their Text1 also have Alignment=2 (center). It doesn't immediately display centered. Instead, it initially displays as 'top centered'. When I enter the cell with the mouse, it eventually corrects the display to middle center, what is what I want. Sparse is False.
>I know I have dealt with this problem before, but I can't remember anymore what did the trick. The only thing that helps (and perhhaps I did that before) is to use setfocus() for all grid-fields in the form's init. That helps, but it introduces another problem, as it prevents a correct install of the form's menu.
>
>Who has an advice?
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform