haroldjclements Posted January 18, 2005 Posted January 18, 2005 Hello all, Does anyone know how to adjust the width of your columns when using a ListView object? listView1.get_Columns().Add("Description", -2, HorizontalAlignment.Left); For some reason I through that the �-2� dictated the column width. However if I adjust this (either way) it just makes the width smaller. Any ideas with be gratefully received. Harold Clements Quote
EFileTahi-A Posted January 18, 2005 Posted January 18, 2005 Hello all, Does anyone know how to adjust the width of your columns when using a ListView object? Harold Clements Hi haroldjclements, use the following line of code: //[0] = number of the column you wish to change this.listView1.Columns[0].Width = 200; You have to add columns to the listview's columns collection for this to work (if u haven't already). See "columns" property in property window and add columns there. Quote
haroldjclements Posted January 18, 2005 Author Posted January 18, 2005 Thanks EFileTahi-A for your response. I don�t suppose that anyone could translate this line into J#? listView.get_Columnsdoes not have a width method! Thanks in advance, Harold Clements Quote
haroldjclements Posted January 18, 2005 Author Posted January 18, 2005 Sorted it :D Rather then declare the columns and the headers together, I created a ColumnHeader object and then used the .set_Width() method. It works fine, so I am happy. Cheers everyone, Harold Clements Quote
EFileTahi-A Posted January 18, 2005 Posted January 18, 2005 lol, sorry, I though It was c#, now that am paying more attention to the sample code you wrote in first place, yes, it's definitaly j# :) And am also glad you manage to solve it :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.