I have a listview .On clicking a button i want to开发者_如何学Python maximize the size of listview.Can anybody help to get a way to maximize the listview?
In addition to set explicitly the width and height you can use DockStyle.Fill
mode to automatically stretch the all window area.
listview1.Dock = System.Windows.Forms.DockStyle.Fill;
Edit: if you want the listview to be full screen, you need to container window to be full screen.
To do that you can use:
this.WindowState = FormWindowState.Maximized; this.FormBorderStyle = FormBorderStyle.None; this.TopMost = true;
Where this referred to the form.
You can set the height and width of the list box the same as you can for any other windows control.
精彩评论