Click to See Complete Forum and Search --> : Autosizing listview columns


hinge
February 26th, 2003, 01:43 AM
I use a listview i detailview - ie. I have some columns...

how do I code the same functionality that I get when I doubleclick between two columns to make the columns autosize ?

I VB6 there was a function called textwidth (or something like that). I .NET there is a function in the graphics object called drawstring that should be able to do the same - but I can't seem to make it work!!!

Anyone got some juicy examples ??

Thank You

DSJ
February 26th, 2003, 08:34 AM
Take a look at System.Drawing.Graphics MeasureString method.