Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

set focus to the first cell in the grid - vb6

I need to automatically setfocus to the first cell (1,1) in my MSFlexgrid on the LostFocus event of my grid. How can I do that simply?

Thanks in advance
0
al4629740
Asked:
al4629740
  • 2
1 Solution
 
Martin LissRetired ProgrammerCommented:
(0, 0) would be the first cell but I used (1, 1).
Private Sub MSFlexGrid1_LostFocus()

With MSFlexGrid1
    .Row = 1
    .Col = 1
    .SetFocus
End With

End Sub

Open in new window

0
 
al4629740Author Commented:
What can I do to make sure (0,0) exists first before processing the code.  I will be doing this from another event also.
0
 
Martin LissRetired ProgrammerCommented:
What do you mean when you ask if (0, 0) exists? (0, 0) always exists. Do you mean instead if it has something in it?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now