Solved

set focus to the first cell in the grid - vb6

Posted on 2014-09-18
3
252 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 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
(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
Comment Utility
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 45

Expert Comment

by:Martin Liss
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now