QUESTION: Transparent UserControl on TabControl
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=12537
Printed Date: 16 November 2024 at 10:35pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: QUESTION: Transparent UserControl on TabControl
Posted By: Jean
Subject: QUESTION: Transparent UserControl on TabControl
Date Posted: 27 October 2008 at 5:08am
Transparency doesn't work with transparent usercontrols(ocx)?
All controls and the usercontrol are set to transparent. The usercontrol itself is transparent, but not the controls on it, as you can see on the second screenshot. Is there a way to solve this problem?
------------- Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0
|
Replies:
Posted By: JantjeKeizer
Date Posted: 27 October 2008 at 5:27am
You can try to use a tabworkspace as background for the usercontrol, adding a single line in the resize event like:
tabworkspace.move 0 ,0 , usercontrol.scalewidth,usercontrol.scaleheight
i think that will work
|
Posted By: Jean
Date Posted: 27 October 2008 at 9:04am
Thank you. Your solution only works correct, if the UserControl fills the whole TabPage.
But if the UserControl is only a part of the TabPage, then you will notice a problem with the gradient of the color.
------------- Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0
|
Posted By: JantjeKeizer
Date Posted: 27 October 2008 at 11:16am
Hmm, yes you are right.
If you are willing to do some ugly stuff here's a horrific 'workaround'
In your UC place this code
Sub Init(X As Single, Y As Single, Width As Single, Height As Single)
TabControlPage1.Move 0 - X, 0 - Y, Width, Height
Dim myControl As Control
For Each myControl In UserControl.Controls
If Not TypeOf myControl Is XtremeSuiteControls.TabControlPage Then
On Error Resume Next
myControl.Left = myControl.Left + X
myControl.Top = myControl.Top + Y
On Error GoTo 0
End If
Next
End Sub
|
Then in your calling form something like
Private Sub Form_Load()
myControl.Init myControl.Left, myControl.Top, TabControlPage1.Width, TabControlPage1.Height
End Sub
|
But only if you really must.
Any other workaround or real solution will be better
|
|