[Gambas-user] GridView.ClientWidth yields incorrect size on Form_Open
T Lee Davidson
t.lee.davidson at gmail.com
Sun Feb 3 18:20:59 CET 2019
That's it, Gianluigi. You solved it!
Thank you.
Having AutoResize = True seemed incompatible with making a *different* column expand. Now the question is, is this expected
behavior or a bug? I'll start a new thread to ask that.
And, thank you also to Charlie, Denis, and Benoît for your input.
And, Rolf, does this solve your issues as well?
___
Lee
On 2/3/19 7:40 AM, Gianluigi wrote:
> To be clearer:
> It all depends on how AutoResize is set, for Expand to work fine, it must be set to true.
> Try this which it seems simpler:
>
> '------------------------------
> Public Sub Form_Open()
>
> Dim Headers As String[] = ["0123456789", "0123456789", "0123456789", "0123456789"]
>
> With GridView1
> .AutoResize = True ' <---------------!!!
> .Header = GridView.Horizontal
> End With
> GridView1.Rows.Count = 1
> GridView1.Columns.Count = Headers.Count
> For i As Integer = 0 To Headers.Max
> GridView1.Columns[i].Title = Headers[i]
> GridView1[0, i].Text = String(30, "*")
> Next
> GridView1.Columns[0].Expand = True
>
> End
> '-------------------------------------------
>
> Regards
> Gianluigi
More information about the User
mailing list