Solved

EVENT's processing

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

809 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