IGxDialog missing icons

540
4
03-15-2012 09:15 AM
VeeAnnCross
New Contributor II
I accidentally posted this in ArcGIS - general and realized that this is a better place.

Using VB.Net 2008 and ArcGIS 9.3.1 I'm having problems with IGxDialog. Everything works, it's just that when the dialog shows, there are no icons that indicate file type (folder, grid etc.).
This is on my desktop running Windows XP 32-bit.

On my laptop, running Windows XP 32-bit but ArcGIS 9.3, the icons show up.

I found an old thread from 2010 where someone else had this problem (no icons), but did not see a solution.

Can anyone help me?

thanks,
VeeAnn
0 Kudos
4 Replies
NeilClemmons
Regular Contributor III
I believe this is a known issue when you enable XP Visual Styles within your application.  Several of our apps were affected by this and turning off visual styles was not an option because it makes the UI look horrible.  I just tested it again and it no longer seems to be happening.  I'm running ArcGIS 9.3.1 Service Pack 2 on Vista 64-bit.
0 Kudos
VeeAnnCross
New Contributor II
How do I turn the visual styles off?  I tried to do it in the project properties, but that section is grayed out.

this is an old set of tools that I started in VB6. I am not a programmer, but I really like my tools. So I'm sure there are many things wrong with my code.  I've dragged it through conversion steps in Visual Studio 2005 and now 2008. So I suspect it's something along the way - although that doesn't explain why things are fine on my laptop. The only difference between my laptop and desktop is my laptop has 9.3 and desktop has 9.3.1.

I thought perhaps I didn't have all the sp2 pieces I need, so I verified that yesterday.
Still no icons. And although I think it will be ugly without visual styles, I think that's preferable to no icons.

any other light you (or anyone else) can shed on this would be much appreciated.

thanks!
VeeAnn
0 Kudos
NeilClemmons
Regular Contributor III
Our applications are implemented as extensions.  Inside IExtension.Startup() is the following call:

System.Windows.Forms.Application.EnableVisualStyles()

When I was debugging the problem, commenting out this line would cause the icons in the GxDialog to come back.  We opted to enable visual styles and just let the GxDialog not have any icons (we only use it in a few places so it's no big deal).  But, like I said earlier, I no longer seem to have this problem on my development machine.  So, it could be an issue with the operating system.  You're running XP 32-bit and I'm running Vista 64-bit.  I'm pretty sure that when I was debugging this issue that it was back when my development machine was running XP.
0 Kudos
VeeAnnCross
New Contributor II
I am a rookie, and although this was intended to be an extension, somewhere along the way it just became a toolbar with lots of tools. Not quite sure how that happened (which goes to show how poor a programmer I am).

So I don't have the IExtension.Startup

Here's what I've tried.
In the project properties, the whole section "Enable application framework" was grayed out. But within the grayed out section, Enable XP visual styles had a check. So I searched the entire solution for visualstyles and came up with the one location it exists in Application.myapp. This is an XML file and one line read:
<EnableVisualStyles>true</EnableVisualStyles>
I set that to false.
Now in the grayed out enable application framework section, Enable XP visual style no longer has a check, but this had no effect on my toolbar (in debug mode).

So I poked around a little more and decided to try setting the style of the form when I load it.
So I imported system.windows.forms.
Then in the init of the form I put:
System.Windows.Forms.Application.VisualStyleState = VisualStyles.VisualStyleState.NoneEnabled
This flattened my form, but still no icons when I clicked on the button to choose my file output. This is where the filter comes in.
I did find this on Esri's site:
http://support.esri.com/en/bugs/nimbus/TklNMDM0NDE0

I think it's one of those things that folks are sporadically having trouble with so Esri isn't doing to fix it. They probably can't even duplicate it.

So, here I am, a poor programmer (poor as in not a good programmer) kluging things together. Again, if you have any other suggestions, let me know. I actually have several tools that use the gxdialog and would rather have icons than not.

thanks for your help!
VeeAnn
0 Kudos