当前位置: 动力学知识库 > 问答 > 编程问答 >

To maximize the size of listview in c#

问题描述:

I have a listview .On clicking a button i want to 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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: