Page control and Tab pages

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Page control and Tab pages

Post by migro » Sun Oct 31, 2010 3:27 pm

I created the first time a V12 Dialog, because old Dialogs will be updated if changed anything by the dialogdesigner.

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?

:roll:
regards
migro

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Nov 01, 2010 4:59 am

Something like this?

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

User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Mon Nov 01, 2010 10:49 am

Hi and Thanks.

really nice effect, but in this case also the background of the dialog ist transparent. What I'm looking for, have been also in Your code.

Code: Select all

RGB>255,255,255,aColor
   SetDialogObjectColor>Dialog1,,aColor
regards
migro

User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Mon Nov 01, 2010 10:51 am

sry, double sended.
regards
migro

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts