By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,642 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,642 IT Pros & Developers. It's quick & easy.

deployment problem with xp visualstyles

P: n/a
Hello,
I have an application written in vb.net which compiles and builds ok except when I put in the following 3 lines to enable xp style visualstyles

<STAThread()> Public Shared Sub Main()
Windows.Forms.Application.EnableVisualStyles()
Windows.Forms.Application.DoEvents() Windows.Forms.Application.Run(New MdiClient)

End Sub

I now get the following error on machines without visual studio installed but with xp

Application has generated an exception that could not be handled.
process id = 0x290 (656), Thread id = 0x840 (2112)
I build my application exactly the same except with the above lines in and I get the following error message

What do I need on these machines to get the working. All users have the .net framework 1.1 installed. Any ideas would be appreciated.

thank you
Geri
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* "=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=" <Ge*************@discussions.microsoft.com> scripsit:
I have an application written in vb.net which compiles and builds ok except when I put in the following 3 lines to enable xp style visualstyles

<STAThread()> Public Shared Sub Main()
Windows.Forms.Application.EnableVisualStyles()
Windows.Forms.Application.DoEvents() Windows.Forms.Application.Run(New MdiClient)

End Sub

I now get the following error on machines without visual studio installed but with xp

Application has generated an exception that could not be handled.
process id = 0x290 (656), Thread id = 0x840 (2112)
I build my application exactly the same except with the above lines in and I get the following error message


What Windows version are you trying to run the application on?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Hi Herfried,
I'm trying to run the application on windows 98.
..net applications should be able to run on windows 98 and above

"Herfried K. Wagner [MVP]" wrote:
* "=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=" <Ge*************@discussions.microsoft.com> scripsit:
I have an application written in vb.net which compiles and builds ok except when I put in the following 3 lines to enable xp style visualstyles

<STAThread()> Public Shared Sub Main()
Windows.Forms.Application.EnableVisualStyles()
Windows.Forms.Application.DoEvents() Windows.Forms.Application.Run(New MdiClient)

End Sub

I now get the following error on machines without visual studio installed but with xp

Application has generated an exception that could not be handled.
process id = 0x290 (656), Thread id = 0x840 (2112)
I build my application exactly the same except with the above lines in and I get the following error message


What Windows version are you trying to run the application on?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

P: n/a
* "=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=" <Ge*************@discussions.microsoft.com> scripsit:
Windows.Forms.Application.EnableVisualStyles()
Windows.Forms.Application.DoEvents() Windows.Forms.Application.Run(New MdiClient)


Try this:

\\\
If OSFeature.Feature.IsPresent(OSFeature.Themes) Then
Application.EnableVisualStyles()
Application.DoEvents()
End If
Application.Run(...)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

P: n/a
After reading this & other threads, this is what I have come up with:

\\\
<System.STAThread()> _
Public Shared Sub Main()
If OSFeature.Feature.IsPresent(OSFeature.Themes)Then
System.Windows.Forms.Application.EnableVisualStyle s()
End If
System.Windows.Forms.Application.Run(New Form1)
End Sub 'Main
///

I put this code directly underneath the "inherits" section of the Form1
Class. Another thing I found was that you need to set the "FlatStyle"
property on all your controls to "System", otherwise it won't work.

I haven't tried it on anything other than WindowsXP & Server 2003.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.