Solved

EVENT's processing

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

11 Experts available now in Live!

Get 1:1 Help Now