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


msflexgrid control on a form

Posted on 2001-08-28
Medium Priority
Last Modified: 2008-04-01
I've got a msflexgrid control with about 5 fields on a vb form.  When I click into the flexgrid control, I can't tab through the fields specified.  It tabs right out to the next tabstop on specefied on the form.

Is there a way I can tab through that flexgrid and then after the last tab in the flexgrid, tab through the rest of the form?

Question by:graflunds

Expert Comment

ID: 6433947
there is no built-in function for the flexgrid to allow this kind of operation, using that to iterate from the cells.

Using the keyup and keydown events you cannot do it also because VB doesnt catch the <TAB> in these events.

If you really need to do that, you may want to check ark's code, which is a SyshookDLL file that will allow you to catch every keystroke sent to the form.

With that, you can check with is the cell you are into, and when the user tabs until the last cell, sent it to the next tabstop.

hope this helps...

(download syshookdll.zip from http://www.chris-strevel.com.mx/syshookdll.zip)

Expert Comment

ID: 6434847
a local hook into the keyboard messaging system is the only way to achieve the result you are after.  vbaccelerator.com has a good hook dll with source code, and O'reilly has a book "Subclassing and hooking with visual basic" that looks pretty good too.


Expert Comment

ID: 6435102
hi jer
most experts do not propose answers unless you are pretty sure the are the solution, it's better to post as a comment so the question is not locked and is available to the rest of the experts as an open question.
Check http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp to be more clear.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 6435188
hey krees,

thanks for the info... I thought that I was providing a solution, didn't realize that the answer involved actual source code.  Anyway, I will try to limit my responses... again thanks for the input.

Expert Comment

ID: 6435336
There is no built in function to do this.
This is indirectly possible by placing a textbox with the same coordinates as a cell using left and top properties and make the border of the textbox as none. on th lost focus event of the textbox shift the coordinates of the textbox to the next cell and get the focus to that textbox in the next cell.


Author Comment

ID: 6436394
The problem I'm having is I've created this flexgrid from a separate vb project, and made it an activex (ocx) control.  When I run just the separate activex control, the tabs work.  But when I add the control into the form of my main VB project, it tabs right out.  

I've downloaded the syshook file, but am unsure how to use it?

Any help?



Expert Comment

ID: 6438899
hi jer,

sorry to disturb u at this moment.from the question that u have posted i guess u must be involving grids.Presently i had a hard time using grids cos currently i'm doing a search fundtion where all the result have to be presented in grids format erm do u have any idea how the result can be presented in grid or table format.Sorry to ask u a qns here....

Does anyone Knows how to solve this Qns....?
Will be very Grateful to all of u Thanks a million......


Accepted Solution

bhh earned 200 total points
ID: 6438954
If I understand the question right, I have done this.

I have a flexgrid on a form with four columns of data. When you tab into the grid, you are automatically positioned into the first cell of the first row.  Upon entry, I make visible a text box for the user to change the data.  When the user tabs out of the text box, he is positioned at the second box on the first row.  Again, a box is made visible for data entry (although in my case this is a combobox).  The last cell of a row tabs to a hidden box, which updates the grid/tabindex to point to the first cell of the next row (actually to the text box).
Although it appears that the user is tabbing from cell to cell in the grid, they are actually tabbing from dataentrybox to dataentrybox, with the changes being reflected in the grid.  Shift-tabbing also works, as does mouse clicks.  There are only four dataentryboxes (+1 hidden), regardless of the number of rows in the grid.

If this is what you're looking for, let me know.  I can post source code, but it is kind of long.

Expert Comment

ID: 6697173
If this proposed answer has helped you, please accept it, grade it and close this question.  If it did not, reject it and add comments as to your progress and what else is needed.  If no action is taken here by next week, we'll need to decide this outcome.  Expert input always welcome as well.

Community Support Moderator @ Experts Exchange

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

916 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