Solved

EVENT's processing

Posted on 1998-09-21
5
430 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now