SETFOCUS on msflexgrid row

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

SETFOCUS on msflexgrid row

Post by sal21 »

How to setfocus, the row 35 to the up of msfklexgrid?

actually are on immagine.jpg, but when i click on combobox FILA, i need to move up the row 35...

my test code:

Code: Select all

...
With MSFlexGrid1
        .Redraw = True
        .TopRow = 1
        .Row = RIGA
        .Col = 0
        .SetFocus
    End With
...
but dont work!


note:
RIGA=me.CFILA.TEXT, CFILA is the combobox name
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78235
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SETFOCUS on msflexgrid row

Post by HansV »

How about

Code: Select all

    ...
        .Row = RIGA
        .TopRow = RIGA
    ...
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: SETFOCUS on msflexgrid row

Post by sal21 »

HansV wrote:
03 Sep 2021, 11:16
How about

Code: Select all

    ...
        .Row = RIGA
        .TopRow = RIGA
    ...
tks for code...
but this code setfocus the row in center of list, i need to set to the top of list see immagine1

User avatar
HansV
Administrator
Posts: 78235
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SETFOCUS on msflexgrid row

Post by HansV »

Try

.TopRow = RIGA - 8
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: SETFOCUS on msflexgrid row

Post by sal21 »

sal21 wrote:
03 Sep 2021, 13:28
HansV wrote:
03 Sep 2021, 11:16
How about

Code: Select all

    ...
        .Row = RIGA
        .TopRow = RIGA
    ...
tks for code...
but this code setfocus the row in center of list, i need to set to the top of list see immagine1
OK!

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: SETFOCUS on msflexgrid row

Post by sal21 »

HansV wrote:
03 Sep 2021, 13:29
Try

.TopRow = RIGA - 8
OK, WORK