1

I have a .NET winforms application that includes this code:

    private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
    {
        this.BeginInvoke(new MethodInvoker(DeleteCurrentIssue));
    }

    void DeleteCurrentIssue()
    {
        RequestsEntity item = (RequestsEntity)(requestsCollectionBindingSource.Current);
        if (item != null)
        {
            if (MessageBox.Show(this, "Are you sure you wish to delete this request?", "Delete Request", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                RequestsEntity entity = new RequestsEntity(item.RequestId);
                requestsCollectionBindingSource.EndEdit();
                requestsCollectionBindingSource.RemoveCurrent();
                item.Delete();
            }
        }
    }

The code stops executing on the MessageBox.Show line BEFORE the message box is displayed.

(The BeginInvoke was added to try to troubleshoot this problem--originally the code was directly in the handler)

My problem seems similar to: MessageBox hangs

If I remove the parent window of the MessageBox (no 'this' parameter) then I only get the hang about 10% of the time.

I presume this is a concurrency problem and something is blocking my UI thread. One more interesting tidbit--if I press the ALT key once, the MessageBox appears and I can proceed with my program.

UPDATE:

Here's the trace. It looks like my UI controls and ORM are interacting in a problematic way.

mscorlib.dll!System.Collections.Generic.Dictionary<string, System.Guid>.Remove(string key)  Unknown
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.UnsetEntitySyncInformation(string fieldName, SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, SD.LLBLGen.Pro.ORMSupportClasses.IEntityRelation relation)  Unknown
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields>.PerformDesetupSyncRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, System.ComponentModel.PropertyChangedEventHandler propertiesChangedHandler, string fieldName, SD.LLBLGen.Pro.ORMSupportClasses.IEntityRelation relation, bool disconnectFromSaveEvent, bool signalRelatedEntity, string fieldInRelatedEntity, bool resetFKFields, int[] fkFieldIndexes)  Unknown
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.DesetupSyncDepartment(bool signalRelatedEntity, bool resetFKFields) Line 654 C#
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.SetupSyncDepartment(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity) Line 664 C#
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName) Line 275  C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName)  Unknown
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase<AcademicStandards.Data.EntityClasses.RequestsEntity>.PerformSetRelatedEntity(AcademicStandards.Data.EntityClasses.RequestsEntity entity)   Unknown
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore<AcademicStandards.Data.EntityClasses.RequestsEntity>.PerformAdd(AcademicStandards.Data.EntityClasses.RequestsEntity item)    Unknown
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore<System.__Canon>.Add(System.__Canon item) Unknown
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.DepartmentsEntity.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName) Line 240   C#
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName)  Unknown
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.SetSingleRelatedEntityNavigator(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore toSet, string navigatorNameInRelatedEntity, string navigatorNameInThis, SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore currentValue, bool oppositeNavigatorIsPresent) Unknown
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.Department.set(AcademicStandards.Data.EntityClasses.DepartmentsEntity value) Line 990    C#
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.GetSingleDepartment(bool forceFetch) Line 478    C#
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.Department.get() Line 981    C#
AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.DepartmentName.get() Line 1123   C#
[Lightweight Function]  
DevExpress.Data.v14.2.dll!DevExpress.Data.Access.DataListDescriptor.FastPropertyDescriptor.GetValue(object component)   Unknown
DevExpress.Data.v14.2.dll!DevExpress.Data.Helpers.BaseListDataControllerHelper.GetRowValue(int listSourceRow, int column, DevExpress.Data.OperationCompleted completed) Unknown
DevExpress.Data.v14.2.dll!DevExpress.Data.DataController.GetRowValue(int controllerRow, int column, DevExpress.Data.OperationCompleted completed)   Unknown
DevExpress.Data.v14.2.dll!DevExpress.Data.BaseListSourceDataController.GetRowValue(int controllerRow, int column, DevExpress.Data.OperationCompleted completed) Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.GridView.GetRowCellValue(int rowHandle, DevExpress.XtraGrid.Columns.GridColumn column, DevExpress.Data.OperationCompleted completed)   Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.GridView.GetRowCellValue(int rowHandle, DevExpress.XtraGrid.Columns.GridColumn column) Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.GetRowCellValue(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo cell, int rowHandle, DevExpress.XtraGrid.Drawing.GridColumnInfoArgs ci) Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateRowCells(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridDataRowInfo ri, bool forPrinting) Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateRowData(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo bi, bool updateMouse, bool forPrinting)    Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CheckRowData(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo ri) Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateBeforePaint(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo ri)    Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRow(DevExpress.XtraGrid.Views.Grid.Drawing.GridViewDrawArgs e, DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo ri) Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRows(DevExpress.XtraGrid.Views.Grid.Drawing.GridViewDrawArgs e)    Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawContents(DevExpress.XtraGrid.Views.Grid.Drawing.GridViewDrawArgs e)    Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.Draw(DevExpress.XtraGrid.Views.Base.ViewDrawArgs ee)   Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Base.BaseView.Draw(DevExpress.Utils.Drawing.GraphicsCache e)    Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.GridControl.OnPaint(System.Windows.Forms.PaintEventArgs e)    Unknown
DevExpress.Utils.v14.2.dll!DevExpress.Utils.Drawing.ControlPaintHelper.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs paintEventArgs, int layer)    Unknown
DevExpress.Utils.v14.2.dll!DevExpress.Utils.Drawing.ControlPaintHelper.ProcessWMPaint(ref System.Windows.Forms.Message m)   Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.GridControl.CheckProcessMsg(ref System.Windows.Forms.Message m)   Unknown
DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.GridControl.WndProc(ref System.Windows.Forms.Message m)   Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)   Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam)  Unknown
[Native to Managed Transition]  
user32.dll!__InternalCallWinProc@20()   Unknown
user32.dll!_UserCallWinProcCheckWow@36()    Unknown
user32.dll!_DispatchClientMessage@24()  Unknown
user32.dll!___fnDWORD@4()   Unknown
ntdll.dll!_KiUserCallbackDispatcher@12()    Unknown
user32.dll!_DialogBox2@16() Unknown
user32.dll!_InternalDialogBox@24()  Unknown
user32.dll!_SoftModalMessageBox@4() Unknown
user32.dll!_MessageBoxWorker@4()    Unknown
user32.dll!_MessageBoxTimeoutW@24() Unknown
user32.dll!_MessageBoxExW@20()  Unknown
user32.dll!_MessageBoxW@16()    Unknown
System.Windows.Forms.ni.dll!666128f0()  Unknown
[Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]   
[Managed to Native Transition]  
System.Windows.Forms.dll!System.Windows.Forms.MessageBox.ShowCore(System.Windows.Forms.IWin32Window owner, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton, System.Windows.Forms.MessageBoxOptions options, bool showHelp)    Unknown
System.Windows.Forms.dll!System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window owner, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton)   Unknown
AcademicStandards.exe!AcademicStandards.MainForm.DeleteCurrentIssue() Line 295  C#
System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbackDo(System.Windows.Forms.Control.ThreadMethodEntry tme) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(object obj) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallback(System.Windows.Forms.Control.ThreadMethodEntry tme)   Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbacks()    Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)   Unknown
System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m)  Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)   Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam)  Unknown
[Native to Managed Transition]  
user32.dll!__InternalCallWinProc@20()   Unknown
user32.dll!_UserCallWinProcCheckWow@36()    Unknown
user32.dll!_DispatchMessageWorker@8()   Unknown
user32.dll!_DispatchMessageW@4()    Unknown
System.Windows.Forms.ni.dll!660eeffc()  Unknown
[Managed to Native Transition]  


System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData)  Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context)    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm)   Unknown
>   AcademicStandards.exe!AcademicStandards.Program.Main() Line 53  C#
    [Native to Managed Transition]  
    mscoreei.dll!__CorExeMain@0()   Unknown
    mscoree.dll!__CorExeMain_Exported@0()   Unknown
    kernel32.dll!@BaseThreadInitThunk@12()  Unknown
    ntdll.dll!__RtlUserThreadStart()    Unknown
    ntdll.dll!__RtlUserThreadStart@8()  Unknown

Here's a second trace caught at a different point:

    ntdll.dll!_NtWaitForSingleObject@12()   Unknown
    KernelBase.dll!_WaitForSingleObjectEx@12()  Unknown
    mscorlib.ni.dll!728883e3()  Unknown
    [Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]   
    [Managed to Native Transition]  
    mscorlib.dll!System.Type.IsVisible.get()    Unknown
    System.dll!System.SecurityUtils.MethodInfoInvoke(System.Reflection.MethodInfo method, object target, object[] args) Unknown
    System.dll!System.ComponentModel.ReflectPropertyDescriptor.GetValue(object component)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.BindToObject.GetValue()   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Binding.PushData(bool force)  Unknown
    System.Windows.Forms.dll!System.Windows.Forms.BindingManagerBase.PushData(out bool success) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.CurrencyManager_PushData()    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.OnItemChanged(System.Windows.Forms.ItemChangedEventArgs e)    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.List_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.BindingSource.OnListChanged(System.ComponentModel.ListChangedEventArgs e) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.BindingSource.ListItem_PropertyChanged(object sender, System.EventArgs e) Unknown
    System.dll!System.ComponentModel.PropertyDescriptor.OnValueChanged(object component, System.EventArgs e)    Unknown
    System.dll!System.ComponentModel.ReflectPropertyDescriptor.OnValueChanged(object component, System.EventArgs e) Unknown
    System.dll!System.ComponentModel.ReflectPropertyDescriptor.OnINotifyPropertyChanged(object component, System.ComponentModel.PropertyChangedEventArgs e) Unknown
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.OnPropertyChanged(string propertyName)   Unknown
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.PerformSetupSyncRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, System.ComponentModel.PropertyChangedEventHandler propertiesChangedHandler, string fieldName, SD.LLBLGen.Pro.ORMSupportClasses.IEntityRelation relation, bool connectToSaveEvent, ref bool alreadyFetchedFlag, string[] forfNames) Unknown
>   AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.SetupSyncDepartment(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity) Line 666 C#
    AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName) Line 275  C#
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName)  Unknown
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase<AcademicStandards.Data.EntityClasses.RequestsEntity>.PerformSetRelatedEntity(AcademicStandards.Data.EntityClasses.RequestsEntity entity)   Unknown
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore<AcademicStandards.Data.EntityClasses.RequestsEntity>.PerformAdd(AcademicStandards.Data.EntityClasses.RequestsEntity item)    Unknown
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore<System.__Canon>.Add(System.__Canon item) Unknown
    AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.DepartmentsEntity.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName) Line 240   C#
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore.SetRelatedEntity(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore relatedEntity, string fieldName)  Unknown
    SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.EntityCore<System.__Canon>.SetSingleRelatedEntityNavigator(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore toSet, string navigatorNameInRelatedEntity, string navigatorNameInThis, SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore currentValue, bool oppositeNavigatorIsPresent) Unknown
    AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.Department.set(AcademicStandards.Data.EntityClasses.DepartmentsEntity value) Line 990    C#
    AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.GetSingleDepartment(bool forceFetch) Line 478    C#
    AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.Department.get() Line 981    C#
    AcademicStandards.Data.dll!AcademicStandards.Data.EntityClasses.RequestsEntity.DepartmentName.get() Line 1123   C#
    [Lightweight Function]  
    DevExpress.Data.v14.2.dll!DevExpress.Data.Access.DataListDescriptor.FastPropertyDescriptor.GetValue(object component)   Unknown
    DevExpress.Data.v14.2.dll!DevExpress.Data.Helpers.BaseListDataControllerHelper.GetRowValue(int listSourceRow, int column, DevExpress.Data.OperationCompleted completed) Unknown
    DevExpress.Data.v14.2.dll!DevExpress.Data.DataController.GetRowValue(int controllerRow, int column, DevExpress.Data.OperationCompleted completed)   Unknown
    DevExpress.Data.v14.2.dll!DevExpress.Data.BaseListSourceDataController.GetRowValue(int controllerRow, int column, DevExpress.Data.OperationCompleted completed) Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.GridView.GetRowCellValue(int rowHandle, DevExpress.XtraGrid.Columns.GridColumn column, DevExpress.Data.OperationCompleted completed)   Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.GridView.GetRowCellValue(int rowHandle, DevExpress.XtraGrid.Columns.GridColumn column) Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.GetRowCellValue(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo cell, int rowHandle, DevExpress.XtraGrid.Drawing.GridColumnInfoArgs ci) Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateRowCells(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridDataRowInfo ri, bool forPrinting) Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateRowData(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo bi, bool updateMouse, bool forPrinting)    Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CheckRowData(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo ri) Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateBeforePaint(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo ri)    Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRow(DevExpress.XtraGrid.Views.Grid.Drawing.GridViewDrawArgs e, DevExpress.XtraGrid.Views.Grid.ViewInfo.GridRowInfo ri) Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRows(DevExpress.XtraGrid.Views.Grid.Drawing.GridViewDrawArgs e)    Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawContents(DevExpress.XtraGrid.Views.Grid.Drawing.GridViewDrawArgs e)    Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.Draw(DevExpress.XtraGrid.Views.Base.ViewDrawArgs ee)   Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.Views.Base.BaseView.Draw(DevExpress.Utils.Drawing.GraphicsCache e)    Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.GridControl.OnPaint(System.Windows.Forms.PaintEventArgs e)    Unknown
    DevExpress.Utils.v14.2.dll!DevExpress.Utils.Drawing.ControlPaintHelper.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs paintEventArgs, int layer)    Unknown
    DevExpress.Utils.v14.2.dll!DevExpress.Utils.Drawing.ControlPaintHelper.ProcessWMPaint(ref System.Windows.Forms.Message m)   Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.GridControl.CheckProcessMsg(ref System.Windows.Forms.Message m)   Unknown
    DevExpress.XtraGrid.v14.2.dll!DevExpress.XtraGrid.GridControl.WndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam)  Unknown
    [Native to Managed Transition]  
    user32.dll!__InternalCallWinProc@20()   Unknown
    user32.dll!_UserCallWinProcCheckWow@36()    Unknown
    user32.dll!_DispatchClientMessage@24()  Unknown
    user32.dll!___fnDWORD@4()   Unknown
    ntdll.dll!_KiUserCallbackDispatcher@12()    Unknown
    user32.dll!_DialogBox2@16() Unknown
    user32.dll!_InternalDialogBox@24()  Unknown
    user32.dll!_SoftModalMessageBox@4() Unknown
    user32.dll!_MessageBoxWorker@4()    Unknown
    user32.dll!_MessageBoxTimeoutW@24() Unknown
    user32.dll!_MessageBoxExW@20()  Unknown
    user32.dll!_MessageBoxW@16()    Unknown
    System.Windows.Forms.ni.dll!666128f0()  Unknown
    [Managed to Native Transition]  
    System.Windows.Forms.dll!System.Windows.Forms.MessageBox.ShowCore(System.Windows.Forms.IWin32Window owner, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton, System.Windows.Forms.MessageBoxOptions options, bool showHelp)    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window owner, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton)   Unknown
    AcademicStandards.exe!AcademicStandards.MainForm.DeleteCurrentIssue() Line 295  C#
    System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbackDo(System.Windows.Forms.Control.ThreadMethodEntry tme) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(object obj) Unknown
    mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallback(System.Windows.Forms.Control.ThreadMethodEntry tme)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbacks()    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m)  Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam)  Unknown
    [Native to Managed Transition]  
    user32.dll!__InternalCallWinProc@20()   Unknown
    user32.dll!_UserCallWinProcCheckWow@36()    Unknown
    user32.dll!_DispatchMessageWorker@8()   Unknown
    user32.dll!_DispatchMessageW@4()    Unknown
    System.Windows.Forms.ni.dll!660eeffc()  Unknown
    [Managed to Native Transition]  
    System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData)  Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context)    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm)   Unknown
    AcademicStandards.exe!AcademicStandards.Program.Main() Line 53  C#
    [Native to Managed Transition]  
    mscoreei.dll!__CorExeMain@0()   Unknown
    mscoree.dll!__CorExeMain_Exported@0()   Unknown
    kernel32.dll!@BaseThreadInitThunk@12()  Unknown
    ntdll.dll!__RtlUserThreadStart()    Unknown
    ntdll.dll!__RtlUserThreadStart@8()  Unknown
Community
  • 1
  • 1
scotru
  • 2,563
  • 20
  • 37
  • Just edited--it was originally just a button handler and now is as above. – scotru Sep 09 '15 at 07:21
  • 2
    There is no signal in the snippet at all. You'll have to use the debugger, ensure you have unmanaged debugging enabled and the Microsoft Symbol Server configured. Post the stack trace you see when use Debug > Break All and select the main thread. – Hans Passant Sep 09 '15 at 08:28

2 Answers2

1

I managed to resolve this with some help from another forum. The problem was that all my UI controls on the parent window were getting repaint events from the MessageBox before it was displayed (standard behavior). But in this case, the UI control repaint was triggering a ListChanged event in my ORM library. The ListChanged event was then triggering a UI repaint, which led to an infinite loop of messages.

Apparently the message pump in the MessageBox UI couldn't ever get its own paint event handled. So as a result I got the "modal" effects of the MessageBox without the box itself ever being painted. The app was not exactly frozen but was waiting for a response to a modal dialog that had never been painted.

I resolved the issue by refactoring the code calling my ORM library in such a way that the ListChanged event was avoided.

ryanyuyu
  • 6,366
  • 10
  • 48
  • 53
scotru
  • 2,563
  • 20
  • 37
0

So it seems your MessageBox appears, but hidden by something, most likely by the window you show it for. It's not easy to debug such things but you can try the following:

  1. Try bring your control to front with this.BringToFront();
  2. Try using the following trick:

    MessageBox.Show(new Form() { TopMost = true }, "Are you sure you wish to delete this request?"...);
    

It will create new topmost form and show MessageBox relative to that, so it should always appear on top of all of your forms.

Evk
  • 98,527
  • 8
  • 141
  • 191
  • No change in behavior with this. Also tried adding "ShowInTaskbar = true" to see if I could see it there even if behind. When I did this, "Alt" stops making things respond. I can also see a lot of Garbage Collection going on in the performance monitor... – scotru Sep 09 '15 at 09:09
  • Well then most likely issue is not in the code snippet provided, so we won't be able to help you until you publish some more suspicious code. – Evk Sep 09 '15 at 09:12