layout - How can I make sure a ListView item always resizes to show all rows? -


I have a panel that has a TableLayoutPanel , which contains many ListViews And labels .

For each list view, I want to shape it to fit all the content vertically (i.e., each row is visible). TableLayoutPanel should handle any vertical scroll but I can not work to get ListView to change the size of the rows based on the number of rows.

Do I need to handle ONResize and manually resize or is it already something? >

Such a question was suggested to use, but it looked like overkill for what I wanted. Instead, I made this simple overload (down) to resize on the basis of items in the list.

I just tested to display in description mode on Windows Vista, but it is simple and works well.

  Once #pragma  item-> calculates == 0) {// If there is no object present, add one so that we can use it to use - & gt; Item- & gt; Add (""); HeaderHeight = GetHeaderSize (); This- & gt; Things-> clean (); Itemhit = 0; } And {HeadHead = GetHeaderSize (); Itemhit = it- & gt; Item- & gt; Calculation * This-> Items [0] - & gt; Bounce.heat; } // Complete the overall height and resize it System :: Drawing :: Size sz = this-> Shape; Integer limit size = 0; If (this-> Frontline! = System :: Windows :: Form :: Border Style :: None) {borderSize = 2; } Sz.Height = headerHeight + itemsHeight + borderSize; It-> size = sz; } Conserved: /// & lt; Summary & gt; The /// list is located at the top of the first item, to see how long the /// header is. Note: At least one item _must_ or /// exception will be thrown in the list /// & lt; / Summary & gt; /// & lt; Returns & gt; Header height & lt; / Returns & gt; Int GetHeaderSize (zero) {return items [0] - & gt; Bounds. Top; }};  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -