Transparent UserControl Redraw Bug |
Post Reply |
Author | |
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 23 May 2008 at 11:53pm |
Try this:
1) Create a new Standard EXE project in VB6 2) Add a SkinFramework control to the form (and apply the CJ Office2007 normalblue skin to the form hwnd) 3) Add a new UserControl to the project and set the BackStyle property to Transparent 4) Draw a CJ Label on the UserControl (top left corner) and set the Transparent property to True 5) Add the UserControl to the top left corner of the form (so the ControlBox/System menu can cover it) 6) Run the project and click the ControlBox/SystemMenu icon, then click somewhere on the form to dismiss the menu. A portion of the menu remains where the Label control is: |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
It only seems to be a problem (in Vista at least) if you turn of Desktop Composition for the compiled application (Properties > Compatibility tab > Disable Desktop Composition).
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
I wouldn't mind taking a look at it, but if I have to do all that and maybe have different settings that would influence the behaviour, it would be better if you upload a sample project.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Aaron,
I've attached a sample project (you may have to change the path to the skin, depending on where you installed your CJ components). Also, if you are using Vista, it seems the bug only occurs when desktop composition is turned off (after compiling the project, right click the EXE and click Properties. Click the Compatibility tab, and select the "Disable Desktop Composition" check box, then click OK and run the app). I've also noticed another problem (as demonstrated by the Line control on the form) - The CJ Label seems to ignore the Transparent property when it is placed on a Transparent BackStyle UserControl. uploads/20080524_115205_TransparentBug.zip |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Yes, VB don't allow it. Add standard label...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
MS don't allow it. Add no label at all...
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Oleg,
I spoke with Bill yesterday and they aren't going to solve this bug
Well, now it all depends on CodeJock if this issue is going to be solved.
First of all: why does the CJ label looses transparency if put in a usercontrol?
Jason,
I don't know if you need the transparency (like in your sample) with a usercontrol and label. The only thing that is working is setting the usercontrol property Windowless to true. In this case the CJ and MS label will be visible / transparent and CJ label will be repainted properly when the system menu is shown. Note: When you have a windowless usercontrol you can not place controls in it. Hope this will work out for you, but then again we have CJ to back us up
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Aaron,
I don't desperately need transparency on the usercontrol, I just thought it could be useful in the future. Basically, I am creating my own Label & FlatEdit control combination for use in my projects so that I don't have to add one of each every time (and I get a consistent look, spacing, size, etc...). So the windowless workaround won't work in this case. The good news, I don't need transparency at this point as I have always been adding my usercontrol to a form with the same background colour as the usercontrol...Thanks for working on the problem! |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
That's good news If you use a picturebox (in the usercontrol) and add the CJ label to the picturebox, the label does repaint correct (system menu issue you described)
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
I did this. (and I bet every other developer has also done it) And I found that the standard VB label placed in a User Control loses its transparency. And this is a known "problem". My solution was horrible. I look at the screen color when the User Control is drawn and the set the label background color to match. Doesn't work for gradient backgrounds.... but in real life it is hardly noticeable. When I get time I will do it better (or maybe CodeJock will bring out a Control....?) |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Chris,
This is the same approach I ended up taking...in my case it is okay because I'm not placing the control on a gradient background (although that was the type of situation that I wanted to have transparency available for). I guess we're stuck with it! |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |