VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



AutoResize DataGrid

by dietmar bos (2 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (13 Votes)

The Code auto-resizes all columns of a DataGrid.
The longest string of a gridcolumn is the new width of the column. Similar to this ListView- or FlexGrid- feature.
I havn't found anything similar here, so I just want to put it in the codebase.

Inputs
2 parameters: a) pointer to the datagrid b) pointer to any form
Assumes
most tabular controls in VB have a functionality that aligns colums of those table to a 'rational' width, that makes good use of the visible space. Not so with the DataGrid control, which is a fine piece of software in all other regards. To fill this gap, this code here was written.
Code Returns
nothing
Side Effects
none that I know of

Rate AutoResize DataGrid

Download AutoResize DataGrid

Download AutoResize DataGrid (1 KB)

AutoResize DataGrid Comments

No comments have been posted about AutoResize DataGrid. Why not be the first to post a comment about AutoResize DataGrid.

Post your comment

Subject:
Message:
0/1000 characters