Computer Learning Zone CLZ Access Excel Word Windows

Perfect is the enemy of good

-Voltaire
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visual Basic Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Column Resizing
Kevin Robertson 
          
6 years ago
I was wondering if it was possible to prevent a  user resizing the columns in a ListView control.

After several google searches I am unable to find any documentation.
Alex Hedley  @Reply  
           
6 years ago
I'm surprised this isn't a properly, looks like you have to go down into the Win32 API.

Could you use a DataGridView instead?
Kevin Robertson OP  @Reply  
          
6 years ago
Alex,

Actually found some code that works.

In the ColumnWidth Changed event:

        Static blnChangeWidth As Boolean = True

        If blnChangeWidth = True Then
            If e.ColumnIndex = 7 Then
                blnChangeWidth = False
                lvwCurrentAlarms.Columns(e.ColumnIndex).Width = 0
                blnChangeWidth = True
            End If
        End If

Then in the ColumnWidthChanging event:

e.Cancel = True
Alex Hedley  @Reply  
           
6 years ago
That's a nice workaround, I think I saw something similar, just didn't have a chance to try it out.
Does it still let you use the grabber to change the width then just snaps back to the original size?
Kevin Robertson OP  @Reply  
          
6 years ago
It completely surpresses the resize so there is no noticible chang in the width. Curser still changes but that's not too important. The column I don't want resized is actually a hidden column for the full path to a media file.
Richard Rost  @Reply  
          
6 years ago
Nice find.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visual Basic Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/17/2026 11:33:33 AM. PLT: 1s