Posted 19 years ago
by Mike
Using Visual Studio 2005 C#
My project contains two forms:
1) Main form which contains only UI Studio tab strips
2) Secondary form which contains tab strips, dockmanager and toolwindows (some design-time, some run-time).
If I launch the secondary form with "ShowDialog" method, I receive 1 of 2 errors when closing the main form (after closing the secondary form)
Error 1Error 2
If I launch the secondary form using just the "Show" method, then my secondary form does not close immediately when I click the close button in the form's control box. Instead, when I click the button, the form first closes all toolwindows that I created at runtime. Then, when I click it a second time, it closes the secondary form. Finally, when I close the main it closes without any errors.
I have seen a couple of posts from users that seem to have this issue but they all "figured it out" but did not post a resolution. Any ideas? Unfortunately, I am unable to post my code. I can try to reproduce it with a test project (let me know).
Thanks,
Mike
My project contains two forms:
1) Main form which contains only UI Studio tab strips
2) Secondary form which contains tab strips, dockmanager and toolwindows (some design-time, some run-time).
If I launch the secondary form with "ShowDialog" method, I receive 1 of 2 errors when closing the main form (after closing the secondary form)
Error 1
System.InvalidOperationException was unhandled
Message="Object is currently in use elsewhere."
Source="System.Drawing"
StackTrace:
at System.Drawing.Graphics.GetHdc()
at ActiproSoftware.Drawing.DrawingHelper.MeasureString(Graphics g, String text, Font font, StringFormat format)
at ActiproSoftware.UIStudio.TabStrip.TabStripRenderer.MeasureTabStripTab(Graphics g, TabStripPage tabStripPage)
at ActiproSoftware.UIStudio.TabStrip.VisualStudio2005ToolWindowTabStripRenderer.MeasureTabStripTab(Graphics g, TabStripPage tabStripPage)
at ActiproSoftware.UIStudio.TabStrip.VisualStudio2005DocumentWindowTabStripRenderer.MeasureTabStripTab(Graphics g, TabStripPage tabStripPage)
at ActiproSoftware.UIStudio.TabStrip.TabStripTab.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIElement.Measure(Graphics g, Size availableSize)
at ᐦ.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIElement.Measure(Graphics g, Size availableSize)
at ActiproSoftware.UIStudio.TabStrip.TabStrip.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.Measure(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.WinUICore.UIControl.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.PerformLayout()
at ActiproSoftware.WinUICore.UIContainerControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIContainerControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.WinUICore.UIContainerControl.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.PerformLayout()
at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.WinUICore.UIControl.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Control.ControlCollection.Remove(Control value)
at ActiproSoftware.UIStudio.Dock.AutoHideContainer.ᐁ(ToolWindow )
at ActiproSoftware.UIStudio.Dock.DockManager.ᐁ(TabbedMdiWindow[] )
at ActiproSoftware.UIStudio.Dock.DockManager.ᐁ(TabbedMdiWindow[] , Boolean )
at ActiproSoftware.UIStudio.Dock.ToolWindow.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()
System.ArgumentException was unhandled
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.Font.ToLogFont(Object logFont, Graphics graphics)
at System.Drawing.Font.ToLogFont(Object logFont)
at System.Drawing.Font.ToHfont()
at ActiproSoftware.Drawing.DrawingHelper.MeasureString(Graphics g, String text, Font font, StringFormat format)
at ActiproSoftware.UIStudio.Dock.DockRenderer.MeasureAutoHideTabCore(Graphics g, AutoHideTab autoHideTab)
at ActiproSoftware.UIStudio.Dock.VisualStudio2005DockRenderer.MeasureAutoHideTab(Graphics g, AutoHideTab autoHideTab)
at ActiproSoftware.UIStudio.Dock.AutoHideTab.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIElement.Measure(Graphics g, Size availableSize)
at ActiproSoftware.UIStudio.Dock.AutoHideTabGroup.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIElement.Measure(Graphics g, Size availableSize)
at ActiproSoftware.UIStudio.Dock.AutoHideTabStripPanel.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.Measure(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.WinUICore.UIControl.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.PerformLayout()
at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.UIStudio.Dock.AutoHideTabGroup.ᐁ(ToolWindow )
at ActiproSoftware.UIStudio.Dock.AutoHideContainer.ᐁ(ToolWindow )
at ActiproSoftware.UIStudio.Dock.DockManager.ᐁ(TabbedMdiWindow[] )
at ActiproSoftware.UIStudio.Dock.DockManager.ᐁ(TabbedMdiWindow[] , Boolean )
at ActiproSoftware.UIStudio.Dock.ToolWindow.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()
I have seen a couple of posts from users that seem to have this issue but they all "figured it out" but did not post a resolution. Any ideas? Unfortunately, I am unable to post my code. I can try to reproduce it with a test project (let me know).
Thanks,
Mike