Solved

EVENT's processing

Posted on 1998-09-21
5
435 Views
Last Modified: 2008-02-01
I am working with a custom control, and have a question about the processing of events.  The custom control uses MSFlexgrid control, and there is an event RowColChange that fires when the selected row is changed. In the control, I have some fhunctions that I want to perform, but I want them to occur after the msflexgrid does it's thing. Problem is that my event is being handled before MSFlexgrid does it's stuff.


How do I make my code execute after the internal code?

I am trying to change the position to the last row, once the user has bumped the top, but what results is a selection of the entire grid until the keyboard is touched.

Any suggestions are greatly appreciated.

Ronnie
0
Comment
Question by:redbaron082997
[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
5 Comments
 
LVL 3

Expert Comment

by:fguerreiro_inix
ID: 1435943
Call your code from internal code.

Raise your event in msflexgrid events.
0
 
LVL 1

Author Comment

by:redbaron082997
ID: 1435944
In the control, the event is being handled like this:
private sub msFlexGrid1_RowColChange()
   raiseEvent RowColChange() 'This is where the programer will add events. At this time, MSFlexGrid has not completed doing it's stuff, as it should
end sub


0
 
LVL 2

Expert Comment

by:schild
ID: 1435945
Though when selecting a cell's group the RowColChange occure, as far as i know the MSFlexGrid, the RowColChange event doesn't file according to selection changes, but according to cell clicking, which is different from selction of cells group.
The Reason that RowColChange occure is, when you slect a cell's group you are usualy click one of the square corner and then, the cell clicking invoke the RowColChange's event.
In any case, if you mean the cell's clicking event, then at my flexgrid (sp2 version) the event fire after the new cell clicking.
If you mean the selection itself, there is another event called "SelChange", try it.

Good luck
Schild
0
 
LVL 1

Author Comment

by:redbaron082997
ID: 1435946
Here is what is happening:
my program loads data into the grid, and positions the cursor in the center.  Then when the user selects cell 0, it is captured (either by rowcolchange, or selchange) and the data is reloaded, adding 50 records to the top, and 50 to the bottom of record 0, and again positions the cursor, in the middle. The problem is when I capture this event, it has not yet completed it's call stack of positioning to cell 0, and if I tell it to posistion to cell 50, and I perform the rowsel, colcel, to hilite cell 50, then when it finishes the call stack, I get a selection of 0 to 50, due to the msflexgrid.row property changing back to 0 when it leaves either of my event proc's.

Any ideas how to correct this? I am raising the points due to the complexty of the question.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1435947
Start a timer on the event.
private sub msFlexGrid1_RowColChange()
  timer1.enabled = true
end sub

private sub timer1_timer()  ' Or some
 timer1.enabled = false
 'do your stuff here
end sub

0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 …
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 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