PC Review


Reply
Thread Tools Rate Thread

deployment problem with xp visualstyles

 
 
=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=
Guest
Posts: n/a
 
      15th Jul 2004
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
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Jul 2004
* "=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=
Guest
Posts: n/a
 
      15th Jul 2004
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==?=" <(E-Mail Removed)> 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/>
>

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Jul 2004
* "=?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?=" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Terry Olsen
Guest
Posts: n/a
 
      15th Aug 2004
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.EnableVisualStyles()
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Container for VisualStyles =?Utf-8?B?RGFsZQ==?= Microsoft Dot NET Framework Forms 5 17th Nov 2006 04:57 PM
VB 2005 visualstyles problem. nkarnold@googlemail.com Microsoft Dot NET Framework Forms 0 18th Aug 2006 02:02 PM
Enterprise Library deployment problem. Why needs to InstallUtil DLLs to the deployment server? If not, Registry Error whould shown. Benny Ng Microsoft ASP .NET 0 3rd Oct 2005 06:40 AM
VisualStyles in DeskBands =?Utf-8?B?RGFpc3VrZQ==?= Microsoft Dot NET Framework 0 25th Aug 2005 06:31 PM
Disable XP VisualStyles =?Utf-8?B?QWx2byB2b24gQ29zc2VsIEk=?= Microsoft C# .NET 0 17th Jul 2005 09:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:34 AM.