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

XP look on buttons etc

P: n/a
Hi,

For some reason my App has stopped displaying buttons and other such
controls with the XP style.

They have all reverted back to the standard style button.

I have the buttons.flatstyle set to = system, but they are the same as
standard.

I have the Windows XP Style set in my display properties (properties of the
desktop), and the color scheme set to silver, and all the buttons in other
applications look as they should.

How do I get my buttons back to the XP style.

Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
"Aussie Rules" <so*****@somewhere.com> schrieb:
For some reason my App has stopped displaying buttons and other such
controls with the XP style.

They have all reverted back to the standard style button.

I have the buttons.flatstyle set to = system, but they are the same as
standard.

I have the Windows XP Style set in my display properties (properties of
the desktop), and the color scheme set to silver, and all the buttons in
other applications look as they should.


Enabling Windows XP Visual Styles for Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=xpvisualstyles&lang=en>

--
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 #2

P: n/a
Hi,

Thanks for this.

I have created a manifest file as described. I hope i did this correct as
all i did was add a text file, rename it to the projectname.manifest, and
changed the details within the xml I pasted from the site into the manifest
file

The bit that is confusing is that last bit that makes reference to adding in
the details to the referneces:

"
1.. Add the manifest to your application's resource file as follows:
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.exe.manifest"

"
I have no idea what this means or how to do it. I tried to add a reference
to my project to the manifest file, but it didn't like that very much.

Thanks

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Aussie Rules" <so*****@somewhere.com> schrieb:
For some reason my App has stopped displaying buttons and other such
controls with the XP style.

They have all reverted back to the standard style button.

I have the buttons.flatstyle set to = system, but they are the same as
standard.

I have the Windows XP Style set in my display properties (properties of
the desktop), and the color scheme set to silver, and all the buttons in
other applications look as they should.


Enabling Windows XP Visual Styles for Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=xpvisualstyles&lang=en>

--
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
"Aussie Rules" <so*****@somewhere.com> schrieb:
I have created a manifest file as described. I hope i did this correct as
all i did was add a text file, rename it to the projectname.manifest, and
changed the details within the xml I pasted from the site into the
manifest file


Am I right that you are using .NET 1.0?

--
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 #4

P: n/a
No,

VS.net 03 with .net 1.1
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OD**************@TK2MSFTNGP14.phx.gbl...
"Aussie Rules" <so*****@somewhere.com> schrieb:
I have created a manifest file as described. I hope i did this correct as
all i did was add a text file, rename it to the projectname.manifest, and
changed the details within the xml I pasted from the site into the
manifest file


Am I right that you are using .NET 1.0?

--
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 #5

P: n/a
"Aussie Rules" <so*****@somewhere.com> schrieb:
VS.net 03 with .net 1.1


Then you don't need the manifest stuff. Instead, add the following code to
a code file:

\\\
Public Module Program
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object.

--
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 #6

P: n/a
Hi,

Thanks for you help, I added that in, but i still don't have the XP look on
all my buttons on all my forms

Any other tricks to try?

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"Aussie Rules" <so*****@somewhere.com> schrieb:
VS.net 03 with .net 1.1


Then you don't need the manifest stuff. Instead, add the following code
to a code file:

\\\
Public Module Program
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object.

--
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 #7

P: n/a
"Aussie Rules" <so*****@somewhere.com> schrieb:
Thanks for you help, I added that in, but i still don't have the XP look
on all my buttons on all my forms


Create a Windows Forms project from scratch, add the code I posted, add a
button to the form and set its 'FlatStyle' to 'System'. Then run the
application. Is it shown with Visual Styles applied?

--
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 #8

P: n/a
and all the button .style is set to system, so it should pick up the style

do i have to do something within each form in my project ?

"Aussie Rules" <so*****@somewhere.com> wrote in message
news:Oe**************@TK2MSFTNGP10.phx.gbl...
Hi,

Thanks for you help, I added that in, but i still don't have the XP look
on all my buttons on all my forms

Any other tricks to try?

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"Aussie Rules" <so*****@somewhere.com> schrieb:
VS.net 03 with .net 1.1


Then you don't need the manifest stuff. Instead, add the following code
to a code file:

\\\
Public Module Program
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object.

--
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 #9

P: n/a
Yes that works fine.

So I have gone back to my project and rechecked everything, and it seems
fine.

I have added a empty form to the proper project, and tested it. It works
fine, as long as none of my other code is with the code you posted.

It doesn't seem to make sense.

My propery project has a global.vb file, and the project startup property is
set to that(sub main).

I have attached the sub main below, where you can i see how i have put the
code in.

Something here is stopping it from working, but i can not see what it could
be.

Thanks

---------------
Public Sub Main()

Application.EnableVisualStyles()

Application.DoEvents()

Dim aKey As RegistryKey

Dim bgConnection As String

aKey = Registry.CurrentUser.OpenSubKey("software\XXXX")

Dim frmSPlash As New frmSplash

Dim ObjLoginDetails As New clsLogin

Try

frmSPlash.txtServer.Text = "windows2003e"

ObjLoginDetails.strLoginServer = frmSPlash.txtServer.Text

ObjLoginDetails.strLoginUserID = frmSPlash.txtUserID.Text

ObjLoginDetails.strLoginUserPWD = frmSPlash.txtPwd.Text

ObjLoginDetails.ConnectToDB()

frmSPlash.ShowDialog()

If SetUpUserSecurity(ObjLoginDetails.strLoginUserID,
ObjLoginDetails.strLoginUserPWD) Then

End If

Catch

MsgBox(Err.Description)

End

End Try

Try

intSiteID = aKey.GetValue("SiteID")

strAgentName = aKey.GetValue("LastGoodID")

If intSiteID <> "0" Then

strConnection = aKey.GetValue("BackgroundConn")

Else

MsgBox("no Site ID")

End If

Catch

End Try

If SqlConnection.State.Closed Then

MsgBox("No SQL Connection")

End

End If

Try

SetUpconstDatasets()

Application.Run(New frmMain)

Catch ex As Exception

MsgBox(Err.Description)

End Try

End Sub


Nov 21 '05 #10

P: n/a
"Aussie Rules" <so*****@somewhere.com> schrieb:
So I have gone back to my project and rechecked everything, and it seems
fine.


I feel sorry, but I don't have an idea what can be causing the problem. Are
you using any 3rd-party controls (maybe ActiveX controls) on the specific
form?

--
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 #11

This discussion thread is closed

Replies have been disabled for this discussion.