eequalsmc2plus1
Programmer
Hey,
I got a flex grid, put some stuff in it and then I want to resize each column to be a specific length, depends on length of string added to column.
But msflexgrids use twips, cant change it.
What the best way to dynamically resize the columns ?
Is there a setting for it ? cant find it if there is.
Only way I can think of is 2 get the length of the text added to the column, say 10 chars and * it by ??? to get it into twips. 1cm = +-500 twips so ??? probably about 166.
Isnt there a better way ?
t1 = " t2 = "iiiiiiiiii"
t3 = "MMMMMMMMMM"
MSFlexGrid1.Col = 1
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = t1
MSFlexGrid1.ColWidth(1) = Len(t1) * 166
MSFlexGrid1.Col = 2
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = t2
MSFlexGrid1.ColWidth(2) = Len(t2) * 166
MSFlexGrid1.Col = 3
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = t3
MSFlexGrid1.ColWidth(3) = Len(t3) * 166
Doesnt work well cause the iiiii's take up much less space then ???
I got a flex grid, put some stuff in it and then I want to resize each column to be a specific length, depends on length of string added to column.
But msflexgrids use twips, cant change it.
What the best way to dynamically resize the columns ?
Is there a setting for it ? cant find it if there is.
Only way I can think of is 2 get the length of the text added to the column, say 10 chars and * it by ??? to get it into twips. 1cm = +-500 twips so ??? probably about 166.
Isnt there a better way ?
t1 = " t2 = "iiiiiiiiii"
t3 = "MMMMMMMMMM"
MSFlexGrid1.Col = 1
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = t1
MSFlexGrid1.ColWidth(1) = Len(t1) * 166
MSFlexGrid1.Col = 2
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = t2
MSFlexGrid1.ColWidth(2) = Len(t2) * 166
MSFlexGrid1.Col = 3
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = t3
MSFlexGrid1.ColWidth(3) = Len(t3) * 166
Doesnt work well cause the iiiii's take up much less space then ???