Solved

set focus to the first cell in the grid - vb6

Posted on 2014-09-18
3
287 Views
Last Modified: 2014-09-18
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
Comment
Question by:al4629740
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40331945
(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
 

Author Comment

by:al4629740
ID: 40331960
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
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40331985
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question