Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I'm writing a program in visual basic .net 2003, and i used a manifest file to get the windows xp themes to work with the program. Everything worked fine until i added the flash.ocx file to my program to play flash animations. When i added the flash object to my form, the windows xp themes stopped working on most of the controls (buttons, labels, group boxes, radio buttons, etc.), but the xp theme still works on the TabControl i'm using. Can anyone help me figure out why this is happening, and how i can still use the flash object and have the windows xp theme still work? I'm running windows xp professional sp1. Thanks.
Posted

VB 2003 has native support for visual styles. Try setting each control's FlatStyle to System, then use Application.EnableVisualStyles() in your startup form, i.e.:

'right after #Region " Windows Form Designer generated code "
Public Shared Sub Main()
   Application.EnableVisualStyles()
   Application.Run(New Form1) 'where Form1 is the name of your form

End Sub

Posted

I was already using Application.EnableVisualStyles() but i wasn't using what you wrote under it. I added that to the code and i got this error:

 

An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll

 

Additional information: Error creating window handle.

 

But like i said earlier, everything worked fine, until i added the flash object to my program, then only some of the visual styles worked. This is a list of all the controls i'm using in the program:

 

MainMenu

TabControl - visual styles work

StatusBar - visual styles work

Labels - can't really tell

group boxes - visual styles not working

buttons - visual styles not working

radio buttons - visual styles not working

flash.ocx object - doesn't apply

 

I'm also using a manifest file too. If i delete the flash object from the form, visual styles work on all applicable controls, if i put it back, visual styles only work on some :(

Posted
Did you ever get EnableVisualStyles() to work? Try using it with a new project; add a button and once you get the XP styles to work, add the flash object and see what happens. There's been a few times when .net 2003 has just quit working for me (won't load my controls, won't indent, etc, and sometimes it even makes VB case-sensitive).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...