Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Skin Framework
  New Posts New Posts RSS Feed - Transparent UserControl Redraw Bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Transparent UserControl Redraw Bug

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: Transparent UserControl Redraw Bug
    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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2008 at 12:01am
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

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2008 at 6:42am
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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2008 at 11:52am
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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2008 at 1:30pm
Hi,
 
Yes, VB don't allow it.  Add standard label...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 2008 at 12:17am
Originally posted by oleg oleg wrote:

Hi,
 
Yes, VB don't allow it.  Add standard label...
 
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....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 12:33am
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?
  • A    Don't know
  • B    VB / usercontrol thing
  • C    Because......
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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 11:04am
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

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2008 at 2:49am
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....
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2008 at 2:34pm
Originally posted by jpbro jpbro wrote:

Hi Aaron,

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...).


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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2008 at 7:58pm
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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.110 seconds.