Hello everyone
I want to make my datagridview growing when my windows size grows up
i don't know what to do , it really disturbs me , cause i my datagridview size doesn't change when i maximise my window
Thank u
Printable View
Hello everyone
I want to make my datagridview growing when my windows size grows up
i don't know what to do , it really disturbs me , cause i my datagridview size doesn't change when i maximise my window
Thank u
You can either set the Dock property to Fill so it fills the entire form area with the dgv or you can use the Form1_Resize event to code in the appropriate dgv values based upon the current form size.
Hi there,
You could also try a TableLayoutPanel if you need a little more control over where the grid is: http://msdn2.microsoft.com/en-us/lib...el(vs.80).aspx
Download the 101 VB.NET examples on MSDN as well. There is a full example in there using the TableLayoutPanel to do what you want.
Its not always a good idea to use a tablelayoutpanel as minor resizing like this can be done easily with a line of code vs having to add another control like the tlp. ;)
Right. If the grid is the only thing on the form, then the panel is definitely overkill. :bigyello:Quote:
Originally Posted by RobDog888
But Im assuming that with the way the question is asked, it is perhaps the only control, or maybe there are others but he can handle them, that needs resizing.
Heres and example saadmechiche.
Code:Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState <> FormWindowState.Minimized Then
Me.DataGridView1.Size = New Size(Me.ClientRectangle.Width - 100, Me.ClientRectangle.Height - 100)
End If
End Sub
THANK You all
I have now my answer
see you soon
Cool, glad to help.
Ps, dont forget to Resolve your thread from your Thread Tools menu. ;)