IceBreakerG Posted September 24, 2003 Posted September 24, 2003 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. Quote
Photovoltaic Posted September 24, 2003 Posted September 24, 2003 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 Quote
IceBreakerG Posted September 24, 2003 Author Posted September 24, 2003 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 :( Quote
IceBreakerG Posted September 24, 2003 Author Posted September 24, 2003 One more thing. The visual styles work on the buttons in message boxes, but not on the form. Quote
Photovoltaic Posted September 25, 2003 Posted September 25, 2003 Did you set all the controls' FlatStyle property to System? Quote
IceBreakerG Posted September 25, 2003 Author Posted September 25, 2003 Yes. Like i said, the visual styles were working fine before i added the flash object. I added the flash object and only some work now. Quote
Winston Posted September 25, 2003 Posted September 25, 2003 r u sure the flash object didnt reset the flatstyle properties? have u tried an actual manifest file? Quote
Photovoltaic Posted September 25, 2003 Posted September 25, 2003 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). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.