[Gambas-user] Resize columnview column widths

ron ronstk at ...239...
Fri Apr 9 18:22:54 CEST 2004


Wel I put next sub in almost every event of the columnview.
Now it stays fixed, Stupid.

In the Find form I did use columnview to and never touch the Adjust  or 
AutoResize and they stay fixed width as set by the 1 time initialization sub.

---------
PUBLIC SUB FixColumnView()
  DIM i AS Integer
  WITH columnview1
  '  .Columns.AutoResize=FALSE <---------
 '   .Columns.Adjust=FALSE <------------
    FOR i=0 TO .columns.count-1
      .Columns[i].AutoResize=FALSE
      .Columns[i].width=80
'      .Columns[i].Adjust=FALSE   'gives error  <---------
    NEXT
  END WITH    
END
--------
I feel stupid :(
Can I get from someone the exact syntax for the next lines.
------------------------
ColumnView1.AutoResize=FALSE
ColumnView1.Columns..AutoResize=FALSE
ColumnView1.Columns[x]..AutoResize=FALSE

AutoResize from help under .ColumnViewColumn:
PROPERTY AutoResize AS Boolean
Indicates if the columns should automatically resize when its contents change. 

Is this per column or all columns together, after all here is told columns?

This should be a onetime setting but it looks to me I have to do after every 
columnview.clear and that is for items and has nothing to do with columns.

--------------------------------
ColumnView1.Adjust=
ColumnView1.Columns.Adjust=
ColumnView1.Columns[x].Adjust=

Adjust from help under .ColumnViewColumns:
 SUB Adjust ( ) 
Adjust the size of the last column so that it fits to the ColumnView width.

Here I know now the =FALSE is wrong.
But it should be a property,  true or false, a method should be done after 
every resize of the control in this case?
Beside of that ColumnView.Columns[ColumnView.columns.count-1].adjust ?
It has to do the last and is working on the last so why not
ColumnView.Adjust=True
ColumnView.Columns.Adjust seems not to work in my case.
Must it be done after a resize of the control?
It has not that event.

is adjust here only for the column with index [x] ?
the help does not show that (the [x]) in a clear way and that drives me crazy.
-----------------------------------------
ColumnView1.Columns[x].text="mytext"
this one i understand can only with [x], or ????

I can not figure out how it should be.

I'm tired after 2 hours study now, I do not like this.
Why does it work in one program without setting anything
and do i have to put it now in _Change _Select _Click and Form_Resize ????

Sad Ron. :=(




More information about the User mailing list