Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

reduce size of column in a datagrid

I have a data grid in vb6.  The columns have a default width when the records pull up.  I want to decrease the width of the columns in the datagrid, so that it looks like it will only hold one number.

How can I do this, if at all?
ASKER CERTIFIED SOLUTION
Avatar of lppperes
lppperes
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of al4629740

ASKER

If i do:

 DataGrid1.Columns(0).Width = 0
 DataGrid1.Columns(1).Width = 100

will they be two different lengths?
Yes. Each column will have a different size. In fact, if you set first column with value 0, it will be "invisible".
When I do :

 DataGrid1.Columns(1).Width = 500
 DataGrid1.Columns(2).Width = 250
 DataGrid1.Columns(3).Width = 250
 DataGrid1.Columns(4).Width = 250
 DataGrid1.Columns(5).Width = 250
 DataGrid1.Columns(6).Width = 250

I get subscript out of range for the second line.  Why?
never mind.  found the problem