Keyboard shortcut for resizing all columns in a listview control to fit

The keyboard shortcut for resizing all columns in a report-mode (also known as Details mode) list view control to fit the current content width is Ctrl+Num+. That's the + key on the numeric keypad. (If you're using Explorer, you can also right-click the column header and choose Size All Columns to Fit.)

Note that this command is a verb, not a state, so it takes into account the contents of the listview at the time you press the hotkey. If the contents change and you want the columns resize based on the new contents, you'll have to press the hotkey again.

Comments (17)
  1. xpclient says:

    Here's a compiled AutoHotkey EXE for it:…/SizeAllColumnsToFitWhenRun.exe which you can add to your favorite file manager's toolbar.

  2. Adrian says:


    In a Windows 7 explorer window, it seems to have some minor funky bugs with the Size column, but it sure is nice to not always have to click and drag to untruncate the date columns.

  3. xpclient says:

    Forgot to mention that MSE/Defender consumes massive amounts of CPU when it comes across any AutoHotkey compiled EXE.

  4. MS says:

    This is a great, great tip.  I use keyboard shortcuts a lot, but I have not heard of this one.  Thanks!

  5. MattT says:

    @xpclient: Suggesting that we run an unsigned executable of dubious origin couldn't possibly go wrong now, could it?

  6. @MS says:

    It's even better when it's noted that MSE/Defender don't (doesn't?) much like said unsigned executable of dubous origin.

  7. MC says:

    @xpclient thanks for that random unsigned executable I just ran on my computer to add a toolbar button for an infrequently used command for which a keyboard shortcut exists – do you possibly have a utility to restore the sorting behavior of explorer?

  8. [Ctrl] and the [+/=] key works too…

  9. Ian Yates says:

    Wow – I use the keyboard a LOT in explorer but didn't know that handy tip.  Since a lot of apps use listviews I'll be trying it in various apps too.  Learn something every day :)

  10. The only problem with that hotkey is that I don't have a numpad on my keyboard – the CMStorm QuickFire mechanical keyboard :) And the [Ctrl] + [+/=] does not work for me on Win7 pro.

  11. xpclient says:

    Wow look at all these clueless people not knowing about AutoHotkey. :D If you find it dubious, run it with your favorite AV scanner or decompile it using the AutoHotkey decompiler and run only the script. No need to execute the EXE. Seriously, how ignorant people are.

  12. theraot says:

    @xpclient AutoHotkey may be safe, but trusting it blindly allows any malicious third party to mimic the executable. And since people believe they are not ignorant and trust AutoHotkey, then it passes unnoticed. In particular when by the nature of AutoHotkey, it cannot be digitally signed.

    No amount of tests in enough to show it is safe. I don't know if anybody here will have the patience to decompile it, yet I know I don't.

    Call me clueless, all you want.

  13. hexatron says:

    I just tried this on Windows 7/64.

    It sizes the columns to the visible entries in the list. Scrolling the list to show files with longer names shows those names with ellipsis'.

    This is not what excel does–there, sizing a column takes into account all items in the column, not just the currently-visible ones. This is preferable.

  14. John Doe says:

    How on earth was xpclient's comment even allowed!

    May I post a link to my most pretentious app-that-may-be-a-script too? It tells Windows 8 to stop feeling the need to ask for a valid key, I'm mostly sure there's no native keyboard shortcut for this.

  15. Joshua says:

    @theraot: Can't you verify it's AutoHotkey by binary diff. You know by its architecture what can change and what can't.

    Come to think of it, that might be an interesting idea for digital signatures. The signature signs a byte-range specified by the signing-block.

    Of course, if somebody wants to abuse and say essentially none of the file is signed, they can. Same problem with signed binary doing a LoadLibrary of an unsigned binary.

  16. Sven says:

    Is there a listview message to invoke this command?

  17. foo says:

    "How on earth…?" I'm guessing because this site's for entertainment purposes :)

    @sven. I imagine you could loop through the column count and send one a LVM_SETCOLUMNWIDTH.

Comments are closed.

Skip to main content