Click to See Complete Forum and Search --> : resize a datagrid
How do you resize the columns datagrid when you maximize your screen?
MartinLiss
Jan 27th, 2000, 01:11 AM
Try this.Option Explicit
Public m_dCol0Factor As Double
Public m_dCol1Factor As Double
Public m_dGridFactor As Double
Private Sub Form_Load()
m_dCol0Factor = DataGrid1.Columns(0).Width / Form1.Width
m_dCol1Factor = DataGrid1.Columns(1).Width / Form1.Width
m_dGridFactor = DataGrid1.Width / Form1.Width
End Sub
Private Sub Form_Resize()
DataGrid1.Columns(0).Width = Form1.Width * m_dCol0Factor
DataGrid1.Columns(1).Width = Form1.Width * m_dCol1Factor
DataGrid1.Width = Form1.Width * m_dGridFactor
End Sub
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.