Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
UltraWinTimelineView appears with a red 'X' when scrolling through dates in month view
posted

When I  press the horizontal scrollbar buttons ordrag the horizontal scroll bar of my UltraWinTimelineView control I intermittently encounter a problem where the control appears with a red 'x' instead of updating the control. I've tried to catch the error within the UltraWinTimelineView_Paint event but the error doesn't get triggered there.

I have checked similar threads in this forum but have found no resolutions. We are not threading the control but it keeps happening. We've also tried running the code on some different PCs but get the same result. 

Is there any way around this?

When I click on the red 'X' this error is thrown:

"Index was out of range. Must be non-negative and less than the size of the collection."

The stack trace for the error is:

 

Trace Stack :    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)

   at System.Environment.get_StackTrace()

   at Acquaint.frmSystemError.CreateErrorInfo() in D:\Programming\Acquaint Source\Main\Acquaint\SystemError.vb:line 237

   at Acquaint.FormUtils.ProcessError(String strForm, String strExtraInfo, Boolean booSuppressErrorDialog) in D:\Programming\Acquaint Source\Main\Acquaint\FormUtils.vb:line 432

   at Acquaint.frmSplash.Startup() in D:\Programming\Acquaint Source\Main\Acquaint\Splash.vb:line 360

   at Acquaint.frmSplash.frmSplash_Activated(Object sender, EventArgs e) in D:\Programming\Acquaint Source\Main\Acquaint\Splash.vb:line 97

   at System.Windows.Forms.Form.OnActivated(EventArgs e)

   at System.Windows.Forms.Form.set_Active(Boolean value)

   at System.Windows.Forms.Form.WmActivate(Message& m)

   at System.Windows.Forms.Form.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

   at System.Windows.Forms.UnsafeNativeMethods.SetForegroundWindow(HandleRef hWnd)

   at System.Windows.Forms.Form.Activate()

   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.HideSplashScreen()

   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.MainFormLoadingDone(Object sender, EventArgs e)

   at System.EventHandler.Invoke(Object sender, EventArgs e)

   at System.Windows.Forms.Form.OnLoad(EventArgs e)

   at System.Windows.Forms.Form.OnCreateControl()

   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   at System.Windows.Forms.Control.CreateControl()

   at System.Windows.Forms.Control.WmShowWindow(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

   at System.Windows.Forms.ContainerControl.WndProc(Message& m)

   at System.Windows.Forms.Form.WmShowWindow(Message& m)

   at System.Windows.Forms.Form.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)

   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)

   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

   at System.Windows.Forms.Control.set_Visible(Boolean value)

   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

   at System.Windows.Forms.Application.Run(ApplicationContext context)

   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

   at Acquaint.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading.ThreadHelper.ThreadStart()

Thanks in advance for any help you can provide.

 

James

  • 12333
    posted

    Hi James,

    I know you mentioned that you are not threading the control itself, however, is there any threading going on at all in the app? The only times I have seen the "red x" happen is during threading operations. Many times, developers will fetch or update data on a separate thread, but the data is still bound to the control on the form. This will most definitely cause the "red x". So, try to look everywhere in your app where there is threading code going on to see if anything on the Form or the Control is "being touched" in the separate thread. If it is, then that will be your most likely cause for this problem. The solution would be to safely invoke the code. If we are talking about fetching or updating data in another thread, the solution would be to execute the operation in the other thread and when the results are ready, you need to bring those updates back to the UI thread through the Form's Invoke method.

    Here is a link to a topic and some example code that describes this:

    http://www.yoda.arachsys.com/csharp/threads/winforms.shtml