现有两本程序,其中一本在MultiRow的Header部用鼠标单击的时候,会先触发CellClick事件,然后才会发生光标迁移。
另外一本,在MultiRow的Header部用鼠标单击的时候,会把光标迁移到点击列的第一行的单元格(RowIndex=0),然后才会触发CellClick事件。
请问这个迁移和CellClick事件的触发时机是如何控制的?我们现在想要实现第一种效果,如何可以做到?
下面的运行时的堆栈信息可以参考下,但是为什么一个要呼出MouseDown,一个呼出MouseUp我们分析不了。能不能给讲解下。
参考资料:
第一种动作的堆栈信息:
CGHT003A.exe!CGHT003A.HT003A01.mlsScanOrder_CellClick(Object sender, GrapeCity.Win.MultiRow.CellEventArgs e) 行 1115 Basic
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Cell.OnMouseClick(GrapeCity.Win.MultiRow.CellMouseEventArgs e) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.j.OnMouseClick(System.Windows.Forms.MouseEventArgs e) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.bj.GrapeCity.Framework.Views.IInputable.MouseClick(System.Windows.Forms.MouseEventArgs arguments, GrapeCity.Framework.Views.bu context) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.bh.NotifyMouseMessage(GrapeCity.Framework.Views.ba unit, GrapeCity.Framework.Views.bz m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.d.InnerProcess(GrapeCity.Framework.Views.bz m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.a7.InnerProcess(GrapeCity.Framework.Views.bz m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.Windows.ElementContainerControl.a.SynchronouslyDispatch(GrapeCity.Framework.Views.ax message, object args) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.Windows.ElementContainerControl.OnMouseClick(System.Windows.Forms.MouseEventArgs e) 不明
System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) 不明
> System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Forms.FrameworkControl.WndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.Windows.ElementContainerControl.WndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.GcMultiRow.WndProc(ref System.Windows.Forms.Message m) 不明
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) 不明
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiTouch.as.WndProc(ref System.Windows.Forms.Message m) 不明
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) 不明
[ネイティブからマネージへの移行]
[マネージからネイティブへの移行]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) 不明
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) 不明
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) 不明
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() 不明
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() 不明
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(string[] commandLine) 不明
第二种动作的堆栈信息:
CGMM065A.exe!CGMM065A.MM065A01.mlsRegiDeptSet_NewCellPositionNeeded(Object sender, GrapeCity.Win.MultiRow.NewCellPositionNeededEventArgs e) 行 589 Basic
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.m.a(ref GrapeCity.Win.MultiRow.InternalCellPosition A_0, GrapeCity.Win.MultiRow.InternalCellPosition A_1, GrapeCity.Win.MultiRow.MoveStatus A_2) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.m.a(ref GrapeCity.Win.MultiRow.InternalCellPosition A_0, bool A_1, GrapeCity.Win.MultiRow.MoveStatus A_2) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.m.a(System.Collections.Generic.List<int> A_0, GrapeCity.Win.MultiRow.Models.c A_1, bool A_2) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.MultiRowController.SelectColumnHeaderCell(GrapeCity.Win.MultiRow.InternalCellPosition headerCellPosition, GrapeCity.Win.MultiRow.MultiRowSelectionMode selectionMode, GrapeCity.Win.MultiRow.Models.c action, bool isShiftSelect) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.MultiRowController.ProcessMouseDownCell(GrapeCity.Win.MultiRow.InternalCellPosition cellLocation) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.MultiRowController.ProcessMouseDownForSelection(System.Windows.Forms.MouseEventArgs e) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.MultiRowController.BeginMouseDrag(System.Windows.Forms.MouseEventArgs e) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.b.OnPreviewMouseDown(System.Windows.Forms.MouseEventArgs e, GrapeCity.Framework.Views.bu context) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Controllers.MultiRowController.OnPreviewMouseDown(System.Windows.Forms.MouseEventArgs e, GrapeCity.Framework.Views.bu context) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.Views.y.OnPreviewMouseDown(System.Windows.Forms.MouseEventArgs e, GrapeCity.Framework.Views.bu context) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.bj.GrapeCity.Framework.Views.IInputable.MouseDown(System.Windows.Forms.MouseEventArgs arguments, GrapeCity.Framework.Views.bu context) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.bh.NotifyMouseMessage(GrapeCity.Framework.Views.ba unit, GrapeCity.Framework.Views.bz m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.d.InnerProcess(GrapeCity.Framework.Views.bz m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.a7.InnerProcess(GrapeCity.Framework.Views.bz m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.Windows.ElementContainerControl.a.SynchronouslyDispatch(GrapeCity.Framework.Views.ax message, object args) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.Windows.ElementContainerControl.OnMouseDown(System.Windows.Forms.MouseEventArgs e) 不明
System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseDown(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) 不明
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Forms.FrameworkControl.WndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Framework.MultiRow.v23.dll!GrapeCity.Framework.Views.Windows.ElementContainerControl.WndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiRow.GcMultiRow.WndProc(ref System.Windows.Forms.Message m) 不明
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) 不明
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m) 不明
GrapeCity.Win.MultiRow.v80.dll!GrapeCity.Win.MultiTouch.as.WndProc(ref System.Windows.Forms.Message m) 不明
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) 不明
[ネイティブからマネージへの移行]
[マネージからネイティブへの移行]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) 不明
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) 不明
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) 不明
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() 不明
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() 不明
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(string[] commandLine) 不明 |
|