<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
(Sorry sent to T Lee instead of the mailing list)<br>
<br>
<div class="moz-forward-container">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Hi T Lee,<br>
<br>
Try this code: -<br>
<br>
<i>' Gambas class file</i><i><br>
</i><i><br>
</i><i>Public Sub Form_Open()</i><i><br>
</i><i><br>
</i><i> Dim Headers As String[] = ["012345",
"0123456789012546", "01234567890123456789", "01"]</i><i><br>
</i><i><br>
</i><i> With Me</i><i><br>
</i><i> .Arrangement = Arrange.Vertical</i><i><br>
</i><i> .Padding = 5</i><i><br>
</i><i> End With</i><i><br>
</i><i><br>
</i><i> With GridView1</i><i><br>
</i><i> .Expand = True</i><i><br>
</i><i> .Header = GridView.Both</i><i><br>
</i><i> .Columns.Count = Headers.Max</i><i><br>
</i><i> .Rows.Count = 1</i><i><br>
</i><i> End With</i><i><br>
</i><i><br>
</i><i> GridView1.Columns.Count = Headers.Count</i><i><br>
</i><i> For i As Integer = 0 To Headers.Max</i><i><br>
</i><i> GridView1.Columns[i].Title = Headers[i]</i><i><br>
</i><i> GridView1[0, i].Text = Headers[i]</i><i><br>
</i><i> Next</i><i><br>
</i><i><br>
</i><i> GridView1.Columns.width = -1</i><i><br>
</i><i><br>
</i><i> Debug GridView1.ClientWidth</i><i><br>
</i><i><br>
</i><i>End</i><i><br>
</i><i><br>
</i><i>Public Sub Form_Resize()</i><i><br>
</i><i><br>
</i><i> Debug GridView1.ClientWidth</i><i><br>
</i><i><br>
</i><i>End</i><i><br>
</i><i><br>
</i><i>Public Sub Form_Show()</i><i><br>
</i><i><br>
</i><i> Debug GridView1.ClientWidth</i><i><br>
</i><i><br>
</i><i>End</i><b><br>
</b><br>
Charlie<br>
<br>
On 31/01/2019 23:11, T Lee Davidson wrote:<br>
</div>
<blockquote type="cite"
cite="mid:316affeb-b1ce-2fee-709a-aad37c2c01ee@gmail.com">I am
trying to resize a column other than the last column to take up
the remaining available client space. But, I don't get a correct
value for GridView.ClientWidth until the Form_Show event. Per
the subject line, is this expected behavior or a bug? <br>
<br>
<br>
To reproduce, put a GridView on a new form. Then set FMain.class
to: <br>
<br>
' Gambas class file <br>
<br>
Public Sub Form_Open() <br>
<br>
Dim Headers As String[] = ["0123456789", "0123456789",
"0123456789", "0123456789"] <br>
<br>
With GridView1 <br>
.AutoResize = False <br>
.Header = GridView.Horizontal <br>
End With <br>
<br>
GridView1.Columns.Count = Headers.Count <br>
For i As Integer = 0 To Headers.Max <br>
GridView1.Columns[i].Title = Headers[i] <br>
Next <br>
Debug GridView1.ClientWidth <br>
<br>
End <br>
<br>
<br>
Public Sub Form_Resize() <br>
<br>
Debug GridView1.ClientWidth <br>
<br>
End <br>
<br>
Public Sub Form_Show() <br>
<br>
Debug GridView1.ClientWidth <br>
<br>
End <br>
<br>
<br>
___ <br>
Lee <br>
<br>
<br>
----[ Gambas mailing-list is hosted by <a
class="moz-txt-link-freetext"
href="https://www.hostsharing.net" moz-do-not-send="true">https://www.hostsharing.net</a>
]---- <br>
</blockquote>
<br>
</div>
</body>
</html>