StrataFrame Forum

Visual style error

http://forum.strataframe.net/Topic9744.aspx

By Chan - 6/22/2007

Hi,

My customer hit error while click on browse button. However, I can't reproduce in my machine and also my dealer machine.



Any ideas?



InvalidOperationException

   Visual Styles-related operation resulted in an error because no visual

style is currently active.



Source : System.Windows.Forms



Stack Trace:

at

System.Windows.Forms.VisualStyles.VisualStyleRenderer.IsCombinationDefined(String

className, Int32 part)

at System.Windows.Forms.VisualStyles.VisualStyleRenderer..ctor(String

className, Int32 part, Int32 state)

at

System.Windows.Forms.ScrollBarRenderer.InitializeRenderer(VisualStyleElement

element, Int32 state)

at System.Windows.Forms.ScrollBarRenderer.GetSizeBoxSize(Graphics g,

ScrollBarState state)

at

MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.PositionControls(Control&

ParentControl)

at

MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.AddSearchFields()

at

MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow..ctor(BrowseDialog

BrowseDialogSettings, Boolean PopulateOnShow)

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean

PopulateOnShow)

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog()

at

MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdBrowse_Click(Object

sender, EventArgs e)

at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e,

ToolStripItemEventType met)

at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e,

ToolStripItemEventType met)

at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons

button, Int32 clicks)

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

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

at System.Windows.Forms.ToolStrip.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.Callback(IntPtr hWnd, Int32 msg,

IntPtr wparam, IntPtr lparam)

By Trent L. Taylor - 6/22/2007

There is a known issue regarding themes and .NET controls as it relates to the DateTimePicker and Visual Styles.  Try turning on the Windows Themes service and you may try choosing a theme other than Classic to see if the error goes away.  You can then work your way backwards by going back to Classic but leaving on the Themes service and see if the error comes back.  This is the first thing I would try.