Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Textbox Width Off?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00507402
Message ID:
00507424
Vues:
7
Hi Steve,

Seems like you're doing something too complicated. First of all, why do you need to have all these parameters in your method, if you use only one and parse it?

Secondly, you probably want to call grid refresh after your LayoutRefresh method.

Finally, if you want to parse the string and this is VFP6.0, you can do it this way:
lcStr=strtran(m.lcStr,",",chr(13))
lnItems=alines(laItems,m.lcStr)
In Vfp 7.0 there is a new parameter added to ALINES function.

I didn't try to examine this code carefully, so these are that went to my eyes at the first sight (BTW, what is the correct English expression for this?).



>Can anther pair of eyeballs look at this?
>
>On my form INIT, I create a 1-record cursor and set it as the RecordSource in my grid. Then I have a command button with the following code in it. The recordsource changes fine, but when I get to my LayoutRefresh method in my grid class, I only get the first character of the column.
>
>Use  "tablesamp" in 0 shared
>With ThisForm.GridGeneral1
>	.RecordSource = "tablesamp"
>	.Refresh()
>	.LayoutRefresh("cProj,The Project")
>EndWith
>
>
>And here is the LayoutRefresh code. First I split the passed parameter on the comma, and take the first part as the column/textbox control source, and take the second as the header. The header shows fine, but not the textbox stuff.
>
>Parameters nLType , cCol1 , cCol2 , cCol3 , cCol4 , cCol5
>
>This.ColumnCount = 0
>If VarType(cCol1) ="C"
>	nItemCount = Occurs( "," , cCol1 ) + 1
>	Dimension arItems[nItemCount,1]
>	aItems = ""
>	nLastPos = 1
>	For nCnt = 1 to nItemCount
>		If nCnt < nItemCount
>			arItems[nCnt,1] = SubStr( cCol1 , nLastPos , ;
>			( At ( "," , cCol1 , nCnt) -1 ) - nLastPos +1 )
>		Else
>			arItems[nCnt,1] = SubStr( cCol1 , nLastPos , ;
>			( Len ( cCol1 ) - nLastPos ) + 1)
>		EndIf
>		nLastPos = At( "," , cCol1 , nCnt ) +1
>	EndFor
>EndIf
>This.ColumnCount = This.ColumnCount + 1
>With This.Columns(This.ColumnCount)
>	.Width = 50
>	.Header1.Caption = arItems[2]
>	.Header1.FontName = "Tahoma"
>	.Header1.FontBold = .t.
>	.Header1.FontSize = 8
>EndWith
>With This.Columns(This.ColumnCount).Text1
>	.ControlSource = arItems[1]				
>	.FontName = "Tahoma"
>	.FontBold = .f.
>	.FontSize = 8
>	.Width = 50
>EndWith
>
>? Chr(9) +Chr(9) +Chr(9) + arItems[1]
>? Chr(9) +Chr(9) +Chr(9) + arItems[2]
>
>
>Help!
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform