Donate

Prevent Listview Column From Being Resized In Windows Forms C#

I added the snippet below in the columnwidthchanging event:
switch (e.ColumnIndex)  
        {  
          case 0:  
            e.NewWidth = 400;  
            break;  
          case 1:  
            e.NewWidth = 200;  
            break;  
          case 2:  
            e.NewWidth = 100;  
            break;  
          case 3:  
            e.NewWidth = 100;  
            break;  
          default:  
            break;  
        }  
       e.Cancel = true;
Where 400, 200, and 100 are the original column sizes.

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.