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:
00507648
Vues:
9
Steve,
Two problems in the last "With/EndWith" code. First, you should assign the controlsource to the COLUMN not to the TEXTBOX in the column. Second (and you may have meant this), the 'value' line is assigning the first part of the parameter, "cProj" to the field being displayed. So you are showing the 'cProj' field, but the first record value is now also 'cProj'. Here's the code I tried:
With This.Columns(This.ColumnCount)  && Or just THIS.Column1
   .ControlSource = arItems[1]	
   ***  .Value = arItems[1]    && Commented out
   .FontName = "Tahoma"
   .FontBold = .f.
   .FontSize = 8
   .Width = 50
EndWith
HTH
Barbara


>Sorry for the confusion, here are things again. The problem is that only the first character of the textbox is showing. The header is showing fine.
>
>This is for my "GridGeneral" class, which will do these things:
>    1. Display up to 5 columns passed to it, regardless of total columns in the cursor
>    2. Size the columns to the width of the widest value in each column
>    3. Keep the mouse pointer a pointer (I am going to stick a transparent box over the grid)
>Obviously, I am only on step 1 of this. :)
>
>In the INIT of the grid class, I create a cursor and bind the grid to it, so when the form starts there is something there. Then in a command button I have this code:
>
>Use  "tablesamp" in 0 shared
>With ThisForm.GridGeneral1
>	.RecordSource = "tablesamp"
>	.LayoutRefresh("cProj,The Project")
>	.Refresh()
>EndWith
>
>Here is the LayoutRefresh code in the GridGeneral class. The header shows fine, but not the textbox stuff.
>
>	Parameters cCol1 , cCol2 , cCol3 , cCol4 , cCol5
>		This.ColumnCount = 0
>		If VarType(cCol1) ="C"
>			oColItems = StrTran( cCol1 , "," , Chr(13) )
>			nItemCount = ALines(arItems, oColItems, .t.)
>		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]	
>			.Value = arItems[1]
>			.FontName = "Tahoma"
>			.FontBold = .f.
>			.FontSize = 8
>			.Width = 50
>		EndWith
>
>
>Thanks again for taking a second look!
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform