Sign in to follow this  
Followers 0
nwbyy

Problem with label on picture

3 posts in this topic

#1 ·  Posted (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):

bug.jpg



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

no bug.jpg



OK. But I don't want to have "Tab" written on the window, so I deleted it:

GUICtrlCreateTabItem("")

Then It looks like this:
bug 2.jpg


I'm fighting with this for hours now.
A clue to a solution without creating a tab would be great...

Thank you!

:-)

Edited by nwbyy

Share this post


Link to post
Share on other sites



#2 ·  Posted

You might try playing with this :
    GUICtrlSetBkColor($Label, $GUI_BKCOLOR_TRANSPARENT)
and
    GUICtrlSetState($Pic, $GUI_DISABLE)

Share this post


Link to post
Share on other sites

#3 ·  Posted

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.

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