Hi, I'm using Infragistics Appstyling 13.1 (2060). VB.NET Visual Studio 2010. CLR 4.0
I have experenced for sometime some of my Infragistics Control Objects like the UltraListView, UltraToolbar and UltraExplorerBar flashing black or remaining black at certain time.
I have a AppStyle isl file that I have created and I'm using my own Images for Headers, Progressbar and other areas so I need to have 'All Components' UseOSThemes set to False so my own graphics show.
For test purposes I have created an empty style isl file and have changed the All Components - UseOSThemes to False and have changed nothing else. I have created a Form1 and have created an empty UltraListView, a in a UltraExplorerBar I have created One group and have entrered 3 Items and also added two buttons, one labled Block and the other UnBlock, all from the form nothing special. In the Form Load of have entered the following Infragistics.Win.AppStyling.StyleManager.Load(Application.StartupPath & "\NewStyleSet.isl") to start the StyleApp.
In the Block button _Click I have entered UltraListView.Enabled = False and UltraListView.BeginUpdate, the same for the ExploreBar, in the UnBlock button _Click, Enabled = True and EndUpdate.
Now when I click on the Block button the Two controls turn black until I UnBlock. If I use Only Enabled = False or BeginUpdate and not both together the controls draw correctly. So it seems that you cannot use the both together. If you have UseOSThemes = Default then there is no problem but I cannot use my own Images.
So could somebody please help me in what I need to do to get this to work correctly.
Thank you for your time.
-Paul
Hi Paul,
The BeginUpdate method is specifically designed to prevent the control from painting. So if something tries to paint the form while you are in a BeginUpdate and EndUpdate block, the control will not paint and it will show nothing (a big black box).
So what you are describing here seems like correct behavior.
Hi Mike
Thank you for reply. I Totally agree with you it is just strange that this Black Box only appears if using a isl file. If no App Styling is selected then there is no problem? I would like to use App styling without the Black Box appearing as it looks messy.
I'm trying to change my code to get around this. What options do I have?
Kind Regards
Paul
Hello Paul,
Thanks for your response. If you need any additional assistance don’t hesitate to ask.
Regards
I tried just changing the properties of the controls to UseOSThemes False and I get the same behaviour. I will change my code not to use BeginUpdate and Enabled = False on the same control at the same time with UseOSThemes Off this stops the control from showing Black.
Ah, sorry, I missed that part of your explanation. Again, I'm sure it's not the isl, though. It's probably just that the Isl is turning off themes. So if that's the case, then you should be able to reproduce the same issue without the isl file, by just setting UseOsThemes on both controls to False.
Either way, the difference is probably that when themes are off, something is causing the control or the form to try to paint while inside the BeginUpdate/EndUpdate block. can you post a small sample project demonstrating this so we can check it out?
That's what I did. As my first message states, I created a new isl file with no changes applied to the isl file apart from the All components UseOSThemes = False. This was done as a Test using Infragistics own recommendations (Default) for a isl file. I did this after I stripped out most of my own styling from my own isl, control by control. If I do not use a isl file there is no problem. So why would it not be a isl file?
The only thing I found from using the process of elimination is don't use a isl file(leave my code as is) or use a isl file and don't use Enabled = False and BeginUpdate on the same control. Surely this is not correct?
I do know that if I make sure the UseOSThemes = True then I do not get the Black Box in certain Controls it does however still happen to the TreeView.
All the Isl file does is change the resolved settings of the controls. So it's probably not the use of an isl file in general. It's most likely some particular setting within the isl file that is causing the change in behavior.
Off the top of my head, my guess is that the isl file is setting up the backgrounds of some controls to be transparent. This is a very common cause of painting issues and flickering like you describe - especially if you have multiple layers of transparency. The DotNet framework tends to have trouble with that.
What I would do is make a backup copy of your isl and try to narrow it down by resetting parts of the isl a few at a time and seeing if the problem goes away. By process of elimination, you can narrow down exactly what setting is causing the issue.