<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Peter,<br>
<br>
Try the code below in a new project: -<br>
<br>
<b>'
--------------------------------------------------------------------------------------------------------------------</b><br>
<b>ComboBox1 As ComboBox</b><b><br>
</b><b>TableView1 As TableView</b><b><br>
</b><b><br>
</b><b>Public Sub Form_Open()</b><b><br>
</b><b><br>
</b><b>With Me</b><b><br>
</b><b> .Padding = 5</b><b><br>
</b><b> .Arrangement = Arrange.Vertical</b><b><br>
</b><b>End With</b><b><br>
</b><b><br>
</b><b>ComboBox1 = New ComboBox(Me)</b><b><br>
</b><b><br>
</b><b>With ComboBox1</b><b><br>
</b><b> .Visible = False</b><b><br>
</b><b> .List = ["", "One", "Two", "Three", "Four", "Five"]</b><b><br>
</b><b>End With</b><b><br>
</b><b><br>
</b><b>TableView1 = New TableView(Me) As "TableView1"</b><b><br>
</b><b><br>
</b><b>With TableView1</b><b><br>
</b><b> .Expand = True</b><b><br>
</b><b> .Columns.Count = 2</b><b><br>
</b><b> .Rows.Count = 50</b><b><br>
</b><b>End With</b><b><br>
</b><b><br>
</b><b>Form_Resize</b><b><br>
</b><b><br>
</b><b>End </b><b><br>
</b><b><br>
</b><b>Public Sub TableView1_Click()</b><b><br>
</b><b><br>
</b><b>TableView1.EditWith(ComboBox1)</b><b><br>
</b><b>ComboBox1.Text = ComboBox1.List[1]</b><b><br>
</b><b><br>
</b><b>End</b><b><br>
</b><b><br>
</b><b>Public Sub TableView1_Save(Row As Integer, Column As
Integer, Value As String)</b><b><br>
</b><b><br>
</b><b>TableView1[Row, Column].Text = Value</b><b><br>
</b><b><br>
</b><b>End</b><b><br>
</b><b><br>
</b><b>Public Sub Form_Resize()</b><b><br>
</b><b><br>
</b><b>TableView1.Columns[0].Width = (TableView1.W - (Me.padding *
2)) / 2 </b><b><br>
</b><b><br>
</b><b>End</b><b><br>
</b><b>'
--------------------------------------------------------------------------------------------------------------------</b><b><br>
</b><b><br>
</b>Hope it helps.<br>
<br>
Charlie<b><br>
</b><b><br>
<br>
<br>
</b>On 11/03/2019 14:27, Peter Peyotle wrote:<br>
</div>
<blockquote type="cite"
cite="mid:lgs2q6qdhmc8ho0bili6s565.1552314359498@email.android.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Hello and good day.<br>
<br>
I have the following problem:<br>
<br>
I put a combo box (or another control) in a cell of a tableview.
The ComboBox is set by clicking on the cell.<br>
I use the following code:<br>
'
-----------------------------------------------------------------------------------------------<br>
'Gambas class file<br>
<br>
Private myCombo As ComboBox<br>
<br>
Public Sub form_Open ()<br>
myCombo = New ComboBox (TableView1.Children [0])<br>
Object.Attach (TableView1, Me, "tabEvents")<br>
<br>
TableView1.Columns.Count = 2<br>
TableView1.rows.Count = 15<br>
TableView1.Columns [0] .Width = TableView1.W / 2 - 15<br>
TableView1.Columns [1] .Width = TableView1.W / 2 - 15<br>
End<br>
<br>
Public Sub showCombo (tabIndex As Integer)<br>
Dim Xstart, CorrY As Integer<br>
<br>
myCombo.w = TableView1 [0, 1] .Width<br>
myCombo.h = TableView1 [0, 1] .Height<br>
<br>
myCombo.Y = TableView1 [tabIndex, 1] .Y<br>
myCombo.X = TableView1 [tabIndex, 1] .x<br>
End<br>
<br>
Public Sub tabEvents_Click ()<br>
<br>
show combo (Last.row)<br>
<br>
End<br>
'
--------------------------------------------------------------------------------------------------------------------<br>
<br>
It works very well too.<br>
But, if I scroll the view into the area whose cells are first
visible by scrolling, then the position fails (thus here:
myCombo.Y = TableView1 [tabIndex, 1] .Y)<br>
<br>
Perhaps this can be compensated by a correction factor.<br>
But I think the tableview should also place in the not (always)
visible area correctly.<br>
<br>
Thanks for the help - I need her :-(.<br>
<br>
<br>
<br>
Von meinem Sony Xperia™-Smartphone gesendet<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">
----[ Gambas mailing-list is hosted by <a class="moz-txt-link-freetext" href="https://www.hostsharing.net">https://www.hostsharing.net</a> ]----
</pre>
</blockquote>
<br>
</body>
</html>