[Gambas-bugtracker] Bug #2298: set focus to TableView element

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sun Jul 4 01:27:48 CEST 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2298&from=L21haW4-

Jim SUTHERLAND reported a new bug.

Summary
-------

set focus to TableView element

Type             : Bug
Priority         : Medium
Gambas version   : Unknown
Product          : Unknown


Description
-----------

I want to set focus to a TableView Element(row,col), I can't find a method for this.

Code below(If varkey = 16777220 'Enter) and full program attached.

Public Sub Form_KeyPress()
Dim varKey As Variant
  
  varkey = Key.code
  'Print varkey
  If varkey = 16777216 'Esc
    Quit
  Endif
    
  If varkey = 16777265 'F2
    Search.SetFocus
  Endif
  
  If varkey = 16777238 'pgup
    TableView1.Scroll(0, 0)
  Endif
       
  If varkey = 16777239 'pgdn
    TableView1.Scroll(0, 500)
  Endif
              
  If varkey = 16777220 'Enter
    If search.text <> Null
      For i As Integer = 0 To 56
        If InStr(TableView1[i, 2].Text, search.text)
          TableView1.Select(i)
        Endif 
      Next
    Endif
  Endif      
 End


System information
------------------

/home/june/xl/.src/FMain.class




More information about the Bugtracker mailing list