RE: [Win32 Lib] LV control: how to delete column

new topic     » topic index » view thread      » older message » newer message

prasanta at WRITEME.COM wrote:
> Hi,
> 
> I am using Win32lib V051 and XIDE. I am trying to create create a LV in 
> a Modal window, in which the columns will be dynamic. Depending on 
> certain other fields on the parent window, I would like to change the no 
> of columns and their names before opening the modal window. I can 
> successfully create the new columns using insertListViewColumn the first 
> time, but how do I delete the columns created and create some new ones ?
> Suppose first time I have 4 columns, then the user chooses to close the 
> modal window, change the input and now I need to have 3 columns, how do 
> I delete the 4 th one created last time ?

Excellent question.  I ran across the same problem.  I proposed the 
following change to Win32Lib and I think Matthew Lewis was going to put 
it into the next version.  For now, you can use this:

   eraseItems(your_list_view)
    if col_count > 0 then 
        for i = 1 to col_count do 
            rtn_code = sendMessage(your_list_view, LVM_DELETECOLUMN, 0, 
i-1) 
        end for 
    end if 
    col_count = 0

You'll need to save the column count from the last load of the list view 
for this to work.

Hope this helps!

Jonas

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu