nwbyy Posted July 30, 2017 Posted July 30, 2017 (edited) Hello. I want to use a jpg picture as frame for some text. Maybe it's not the right way to go... #include <GUIConstants.au3> $hGUI = GUICreate ("GUI", 300 , 200, 400 , 400) GUICtrlCreatePic("C:\Pictures\Frame.jpg", 80, 80, 0, 0) GUICtrlCreateLabel("TEXT", 135, 96) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd With this code the result looks like this (a gray rectangle appears under the text): When I put the stuff in a tab, the problem "goes away": #include <GUIConstants.au3> $hGUI = GUICreate ("GUI", 300 , 200, 400 , 400) $hTab = GUICtrlCreateTab(24, 24, 252, 152) GUICtrlCreateTabItem("Tab") GUICtrlCreatePic("C:\Pictures\Frame.jpg", 80, 80, 0, 0) GUICtrlCreateLabel("TEXT", 135, 96) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd OK. But I don't want to have "Tab" written on the window, so I deleted it: GUICtrlCreateTabItem("") Then It looks like this: I'm fighting with this for hours now. A clue to a solution without creating a tab would be great... Thank you! :-) Edited July 30, 2017 by nwbyy
mikell Posted July 30, 2017 Posted July 30, 2017 You might try playing with this : GUICtrlSetBkColor($Label, $GUI_BKCOLOR_TRANSPARENT) and GUICtrlSetState($Pic, $GUI_DISABLE)
nwbyy Posted July 30, 2017 Author Posted July 30, 2017 It seems to work like this: #include <GUIConstants.au3> $hGUI = GUICreate ("GUI", 300 , 200, 400 , 400) GUICtrlCreatePic("C:\Pictures\Frame.jpg", 80, 80, 0, 0) $Label = GUICtrlCreateLabel("TEXT", 135, 96) GUICtrlSetBkColor($Label, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I was looking in the GUICtrlCreateLabel style settings for the invisible back color, but in vain... Did not expect it works like this. Merci beaucoup mikell.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now