Solved

set focus to the first cell in the grid - vb6

Posted on 2014-09-18
3
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 47

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 47

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

738 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