Sign in to follow this  
Followers 0
mtmartis

Subform not appearing with same Windows style

2 posts in this topic

#1 ·  Posted (edited)

I have a form that calls a sub form. The first form window shows correctly (I have Windows 7 so the title bar has the transparent effect), but when the second verification sub form appears, it looks has the Windows 9x style. I am using the Winapiex UDF from

If I remove the Winapiex functions:

_WinAPI_SetThemeAppProperties($STAP_ALLOW_NONCLIENT)

$Theme = _WinAPI_GetThemeAppProperties()

then the sub form appears correctly with the Windows 7 Aero Windows style.

So am I missing something in the sub-form? Or is it a limitation of the UDF? I am hoping for the prior.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <winapiex.au3>

Global $STAP_ALLOW_NONCLIENT , $Msg
$Image = "Image.jpg"
$Theme = _WinAPI_GetThemeAppProperties()
$GUI_Main = GUICreate("Installation", 500, 375,-1,-1)
$Picture = GUICtrlCreatePic(@ScriptDir & "" & $image, 0, 0, 500, 375,$WS_GROUP,$WS_EX_LAYERED)
GUICtrlSetState(-1,$GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("Installer", 65, 10, 475, 30)
GUICtrlSetFont(-1, 16, 800, 0, "Calibri")
GUICtrlSetBkColor(Default, $GUI_BKCOLOR_TRANSPARENT)
$Label2 = GUICtrlCreateLabel("Please select your desired product:", 10, 45, 275, 20)
GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
GUICtrlSetBkColor(Default, $GUI_BKCOLOR_TRANSPARENT)
_WinAPI_SetThemeAppProperties($STAP_ALLOW_NONCLIENT)
$StdEn32 = GUICtrlCreateRadio ("Software Product 1 ",25, 80, 475, 20)
GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetState(-1, $GUI_CHECKED)
$ButtonOK = GUICtrlCreateButton ("OK",130,335,100,25)
GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$ButtonCancel = GUICtrlCreateButton ("Cancel",270,335,100,25)
GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
  Case $Msg = $GUI_EVENT_CLOSE
   ExitLoop
  Case $Msg = $ButtonCancel
   ExitLoop
  Case $Msg = $ButtonOK And $StdEn32 And BitAND(GUICtrlRead($StdEn32), $GUI_CHECKED) = $GUI_CHECKED
       GUIDelete ()
       _CU_MessageBox()
EndSelect
WEnd

Func _CU_MessageBox()
$Form1 = GUICreate("Installation", 353, 171, -1, -1)
GUISetBkColor(0xFFFFFF)
$Yes = GUICtrlCreateButton("Yes", 200, 128, 75, 25)
$No = GUICtrlCreateButton("No", 88, 128, 75, 25)
$Label1 = GUICtrlCreateLabel("Text", 136, 16, 214, 30)
GUICtrlSetFont(-1, 16, 400, 0, "Calibri")
GUISetState(@SW_SHOW)
While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
   Case $GUI_EVENT_CLOSE
    Exit
  EndSwitch
WEnd
EndFunc
Edited by mtmartis

Share this post


Link to post
Share on other sites



You're changing the theme so of course the window will look different, did you expect something else?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0