Gets the combined height of all items in the ListBox.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
This property enables you to determine the height that the ListBox needs to be sized to, in order to display every available item in the list and to avoid displaying vertical scroll bars. If the amount of items in the ListBox is large, sizing the control using the value of the property might cause the ListBox to be sized outside of the client area of the form or the ListBox container.
The following code example demonstrates how to set the Size property of a ListBox based on the value of the property in order to display all items in the ListBox without use of scroll bars. This example requires that a ListBox control, named listBox1, has been added to a form.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.