473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Strange "bug" on EnableVisualStyles?

I am a bit unsure about this "Effect"... My code:

Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()

Dim myMainForm As New FormularioPrincipal

Dim mySplash As New MyClass.SplashScreen
If mySplash.ShowDialog() = DialogResult.OK Then
Application.Run(myMainForm)
End If
End Sub

Visual styles are not enabled in any place on the whole application. However
an external manifest is able to enable visual styles.

With this Code:

Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()

Dim myMainForm As New FormularioPrincipal

'Dim mySplash As New MyClass.SplashScreen
'If mySplash.ShowDialog() = DialogResult.OK Then
Application.Run(myMainForm)
'End If
End Sub

Visual Styles get enabled.

MyClass is a class library wich contains a Windows Form used for the splash
screen of several applications.

I've used this kind of coding before with no problems... Can't even imagine
what could be going wrong. Anyone has faced this problem before?

Nov 21 '05 #1
2 1592
Humm "solved" it on my own... Although I don't really know whats happening,
so any Ideas are welcomed.

On my SplashScreen I've got a Timer in order to show it up (Otherwise it
would just flicker). I've added the next two lines after the timer has
stopped:

Windows.Forms.Application.EnableVisualStyles()
Windows.Forms.Application.DoEvents()

This code is included on the Class Library wich contains the Windows Forms.
Now both the splash screen and the application get Visual Styles Enabled,
but it seems quite strange that the usual way (Inside the application Sub
Main) won't do the job.

Best Wishes
"Juan Pedro Gonzalez" <th******@terra.es> escribió en el mensaje
news:eX**************@TK2MSFTNGP15.phx.gbl...
I am a bit unsure about this "Effect"... My code:

Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()

Dim myMainForm As New FormularioPrincipal

Dim mySplash As New MyClass.SplashScreen
If mySplash.ShowDialog() = DialogResult.OK Then
Application.Run(myMainForm)
End If
End Sub

Visual styles are not enabled in any place on the whole application. However an external manifest is able to enable visual styles.

With this Code:

Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()

Dim myMainForm As New FormularioPrincipal

'Dim mySplash As New MyClass.SplashScreen
'If mySplash.ShowDialog() = DialogResult.OK Then
Application.Run(myMainForm)
'End If
End Sub

Visual Styles get enabled.

MyClass is a class library wich contains a Windows Form used for the splash screen of several applications.

I've used this kind of coding before with no problems... Can't even imagine what could be going wrong. Anyone has faced this problem before?

Nov 21 '05 #2
Hi Juan

There is a problem with EnableVisualStyles in the current version (2003) of
..NET, but not particularly the one you have identified. I can't remember
off-hand what the error message is, but the current recommendation is to use
an external manifest. If you do not you are likely to get intermittent
problems in you application, even with the DoEvents immediately after.

HTH

Charles
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl...
Humm "solved" it on my own... Although I don't really know whats
happening,
so any Ideas are welcomed.

On my SplashScreen I've got a Timer in order to show it up (Otherwise it
would just flicker). I've added the next two lines after the timer has
stopped:

Windows.Forms.Application.EnableVisualStyles()
Windows.Forms.Application.DoEvents()

This code is included on the Class Library wich contains the Windows
Forms.
Now both the splash screen and the application get Visual Styles Enabled,
but it seems quite strange that the usual way (Inside the application Sub
Main) won't do the job.

Best Wishes
"Juan Pedro Gonzalez" <th******@terra.es> escribió en el mensaje
news:eX**************@TK2MSFTNGP15.phx.gbl...
I am a bit unsure about this "Effect"... My code:

Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()

Dim myMainForm As New FormularioPrincipal

Dim mySplash As New MyClass.SplashScreen
If mySplash.ShowDialog() = DialogResult.OK Then
Application.Run(myMainForm)
End If
End Sub

Visual styles are not enabled in any place on the whole application.

However
an external manifest is able to enable visual styles.

With this Code:

Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()

Dim myMainForm As New FormularioPrincipal

'Dim mySplash As New MyClass.SplashScreen
'If mySplash.ShowDialog() = DialogResult.OK Then
Application.Run(myMainForm)
'End If
End Sub

Visual Styles get enabled.

MyClass is a class library wich contains a Windows Form used for the

splash
screen of several applications.

I've used this kind of coding before with no problems... Can't even

imagine
what could be going wrong. Anyone has faced this problem before?


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mhanrahan | last post by:
Hi, I am experiencing a "bug" (maybe I am missing a setting or something) with a Windows MDI application which I am building in c# 2.0. I am doing the following: Create an MDI parent add a...
1
by: Thomas Barnet-Lamb | last post by:
I was wondering if anyone could give me some help with the following. Consider the code snippet: struct qqq{typedef qqq* pointer;}; template<class al> struct foo : public al { template...
2
by: Philipp Schumann | last post by:
Dear all, I'm in the process of designing a distributed application on the basis of ASP.NET, which does not contain of scripts, but of assemblies containing classes that implement IHttpHandler...
9
by: Codex Twin | last post by:
I am re-sending this in the hope that it might illicit a response. I have a corporate client who forces their workstations to get the proxy server details using an automatic proxy discovery script....
0
by: Ubergeek | last post by:
I noticed this bug ever since I installed VC7.1 on the same machine as VC6. Sometimes when I am working with VC6, when I do a build, after the build finishes, the various menu items/toolbars remain...
26
by: Patient Guy | last post by:
The code below shows the familiar way of restricting a function to be a method of a constructed object: function aConstructor(arg) { if (typeof(arg) == "undefined") return (null);...
8
by: gw7rib | last post by:
I've been bitten twice now by the same bug, and so I thought I would draw it to people's attention to try to save others the problems I've had. The bug arises when you copy code from a destructor...
13
by: Jen | last post by:
One user of my application is experiencing an exception "input string not in correct format". But it makes no sense where it is occurring. It is occurring when a string from a textbox ("172") is...
4
by: Sin Jeong-hun | last post by:
I don't get the message so it's hard to debug that, but some of my clients report that they get "The underlying connection was closed unexpectedly" exception. According to this site (http://...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.