Skip to content
Advertisement

Adding a header line to a scrollable canvas with weights

I’m trying get a list of .xlsm files from a folder, and generate a scrollable canvas from which the tabs needed for import can be selected manually using the check buttons (all having the same tab format e.g. tab1, tab2, tab3, tab4).

The major issue I’m having is getting weights to work correctly for the headers in relation to their canvas columns, as longer file names distorts the weight.

Files with short names

Longer file names distorts the column weights

I’ve tried playing with the weights and can’t seem to figure out a workaround. I also attempted using treeview as an alternative but this seems to introduce far bigger issues with using checkbuttons. Would it possible to freeze the top row if the headers were placed inside the canvas itself, or could I implement something like a bind so that the header frames individual columns align with the width of the columns of the canvas frame?

JavaScript

Advertisement

Answer

The simplest solution is to use two canvases, and then set up a binding so that whenever the size of the inner frame changes, you update the headers to match the columns.

It might look something like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement