We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

reduce size of column in a datagrid

al4629740
al4629740 asked
on
Medium Priority
269 Views
Last Modified: 2012-05-07
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?
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
If i do:

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

will they be two different lengths?

Commented:
Yes. Each column will have a different size. In fact, if you set first column with value 0, it will be "invisible".

Author

Commented:
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?

Author

Commented:
never mind.  found the problem
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.