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

Application.EnableVisualStyles() and Splah Screen

P: n/a
Hi.

I made a simple VB.Net 2003 application in which i have one Module with the
Sub Main and two forms with un button in each one.
I run the application on Windows XP Professional.

This is the code in Module1:

Module Module1
Sub Main()
Application.EnableVisualStyles()
Dim frm1 As New Form1
frm1.ShowDialog()
Application.Run(New Form2)
End Sub
End Module

The first problem is that the button on Form1 isn't XP Style, even if the
FlatStyle property is System.
When i press the button on Form1 the form is closed and Form2 appears, but
also in this form the button is not XP style.

But, if i don't show Form1, removing frm1.ShowDialog, the button on Form2 is
ok with XP Style.

In my real application Form1 will be a Spash Screen and before opening Form2
there will be some code.

What's wrong?

Thanks.

Grazie.
Ciao
--
Skysurfer
--
Skysurfer
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Module Module1
Sub Main()
Application.EnableVisualStyles()
Application.DoEvents() '<-----------
Dim frm1 As New Form1
frm1.ShowDialog()
Application.Run(New Form2)
End Sub
End Module
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
Nov 21 '05 #2

P: n/a
"Skysurfer" <sk*********@libero.it> schrieb:
I made a simple VB.Net 2003 application in which i have one Module with
the
Sub Main and two forms with un button in each one.
I run the application on Windows XP Professional.

This is the code in Module1:

Module Module1
Sub Main()
Application.EnableVisualStyles()
\\\
Application.DoEvents()
///
Dim frm1 As New Form1
frm1.ShowDialog()
\\\
frm1.Dispose()
///
Application.Run(New Form2)
End Sub
End Module

The first problem is that the button on Form1 isn't XP Style, even if the
FlatStyle property is System.


'Application.EnableVisualStyles' Bug
<URL:http://www.codeproject.com/buglist/EnableVisualStylesBug.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

P: n/a
"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> ha
scritto nel messaggio news:%2****************@TK2MSFTNGP10.phx.gbl...
Module Module1
Sub Main()
Application.EnableVisualStyles()
Application.DoEvents() '<-----------
Dim frm1 As New Form1
frm1.ShowDialog()
Application.Run(New Form2)
End Sub
End Module
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html

Thank you very much, Mick!!!

--
Skysurfer
Nov 21 '05 #4

P: n/a
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ha scritto nel
messaggio news:%2****************@tk2msftngp13.phx.gbl...
"Skysurfer" <sk*********@libero.it> schrieb:
I made a simple VB.Net 2003 application in which i have one Module with
the
Sub Main and two forms with un button in each one.
I run the application on Windows XP Professional.

This is the code in Module1:

Module Module1
Sub Main()
Application.EnableVisualStyles()


\\\
Application.DoEvents()
///
Dim frm1 As New Form1
frm1.ShowDialog()


\\\
frm1.Dispose()
///
Application.Run(New Form2)
End Sub
End Module

The first problem is that the button on Form1 isn't XP Style, even if the FlatStyle property is System.


'Application.EnableVisualStyles' Bug
<URL:http://www.codeproject.com/buglist/EnableVisualStylesBug.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Thank you very much, Herfried!!!
--
Skysurfer

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.