Now I encountered a problem, how to set page control and the tab pages to transparent (because I'm using a background Image in all my dialogs

Is it possible to get them transparent again, or even to assign a white background color?

Moderators: JRL, Dorian (MJT support)
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 274
Top = 150
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Refresh a combo box'
ClientHeight = 180
ClientWidth = 363
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object mytabs: TPageControl
Left = 0
Top = 0
Width = 363
Height = 180
Align = alClient
TabOrder = 0
ExplicitWidth = 537
ExplicitHeight = 183
object TTabSheet
Caption = 'Page1'
ExplicitWidth = 277
ExplicitHeight = 153
end
object TTabSheet
Caption = 'Page2'
ExplicitWidth = 529
ExplicitHeight = 155
end
object TTabSheet
Caption = 'Page3'
ExplicitWidth = 529
ExplicitHeight = 155
end
end
end
EndDialog>Dialog1
SetDialogObjectColor>Dialog1,,255
GoSub>TransparentDialog,Dialog1,255
Show>dialog1,res1
//TransparentDialog usage
//GoSub>TransparentDialog,DialogName,TransparentColorNumber
SRT>TransparentDialog
Let>dlg_hndl=%TransparentDialog_var_1%.handle
//constants
Let>GWL_EXSTYLE=-20
Let>WS_EX_LAYERED=524288
Let>LWA_COLORKEY=1
//get style attributes of dialog1 window
LibFunc>user32,GetWindowLongA,attribs,dlg_hndl,GWL_EXSTYLE
Let>attribs={%attribs% OR %WS_EX_LAYERED%}
//make selected color transparent
LibFunc>user32,SetWindowLongA,swl,dlg_hndl,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,dlg_hndl,%TransparentDialog_var_2%,0,LWA_COLORKEY
END>TransparentDialog
Code: Select all
RGB>255,255,255,aColor
SetDialogObjectColor>Dialog1,,aColor