Jump to content
Sign in to follow this  
JavaScript_Freek

Pic overlapping Label?

Recommended Posts

JavaScript_Freek

Ok so I think the Picture is overlapping my label...

#include <GUIConstants.au3>
#include <Misc.au3>
#include <File.au3>


$name = InputBox("Log In", "Please enter your name:")


GUICreate("Urbanyx",400,400)
GUISetIcon("C:\Program Files\AutoIt3\beta\Icons\au3.ico", 0)
TrayTip("Welcome to Urbanyx", "You are now logged into urbanyx.", 5, 1)



; MENU
$filem = GUICtrlCreateMenu("File")
GuiCtrlCreateMenuitem ("",$filem)
$exititem2 = GUICtrlCreateMenuitem("Exit", $filem)
$helpmenu = GUICtrlCreateMenu("About")
$aboutitem2 = GUICtrlCreateMenuitem("About", $helpmenu)

; ABOUT
$label2 = GUICtrlCreateLabel("Logged in as:" & $name, 290,29) 

$s_TempFile = _TempFile()
Inetget("http://i36.tinypic.com/2wlzq6e.gif",$s_TempFile)

GUICtrlCreatePic($s_TempFile, 0, 0, 400, 100)

$tab = GUICtrlCreateTab(5, 105, 390, 100)

$tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("lasdasd", 30, 130, 50, 20)

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label2", 30, 130, 50, 20)

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlCreateLabel("label3", 30, 130, 50, 20)

    GUICtrlCreateTabItem("")    ; end tabitem definition

GuiSetState()

While 1
    $msg = GuiGetMsg()
    
    If $msg = $exititem2 Or $msg = -3 Or $msg = -1 Then ExitLoop
    If $msg = $aboutitem2 Then Msgbox(0,"About","Sample Menu coded by Dan http://sodadome.com") 


WEnd

GUIDelete()

Exit

See where the user icon is? Well next to it should say "Logged in as: $name" and its not. I am thinking its being overlapped! ;)


[center]Cookyx.com :: Simple LAN Chat[/center]

Share this post


Link to post
Share on other sites
AdmiralAlkex

Things will be created in the order you write them down so you create the pic on/above the label. You should move the GUICtrlCreatePic() so it is first and then use:

GUICtrlSetState(-1, $GUI_DISABLE)

so you can click on stuff. A quick example:

#include <GUIConstants.au3>
#include <Misc.au3>
#include <File.au3>


$name = InputBox("Log In", "Please enter your name:")


GUICreate("Urbanyx",400,400)
GUISetIcon("C:\Program\AutoIt3\beta\Icons\au3.ico", 0)
TrayTip("Welcome to Urbanyx", "You are now logged into urbanyx.", 5, 1)



; MENU
$filem = GUICtrlCreateMenu("File")
GuiCtrlCreateMenuitem ("",$filem)
$exititem2 = GUICtrlCreateMenuitem("Exit", $filem)
$helpmenu = GUICtrlCreateMenu("About")
$aboutitem2 = GUICtrlCreateMenuitem("About", $helpmenu)

; ABOUT
$s_TempFile = _TempFile()
Inetget("http://i36.tinypic.com/2wlzq6e.gif",$s_TempFile)
GUICtrlCreatePic($s_TempFile, 0, 0, 400, 100)
GUICtrlSetState(-1, $GUI_DISABLE)

$label2 = GUICtrlCreateLabel("Logged in as:" & $name, 290,29) 

$tab = GUICtrlCreateTab(5, 105, 390, 100)

$tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("lasdasd", 30, 130, 50, 20)

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label2", 30, 130, 50, 20)

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlCreateLabel("label3", 30, 130, 50, 20)

    GUICtrlCreateTabItem("")   ; end tabitem definition

GuiSetState()

While 1
    $msg = GuiGetMsg()
    
    If $msg = $exititem2 Or $msg = -3 Or $msg = -1 Then ExitLoop
    If $msg = $aboutitem2 Then Msgbox(0,"About","Sample Menu coded by Dan http://sodadome.com") 


WEnd

GUIDelete()

Exit

Share this post


Link to post
Share on other sites
Valuater

Just fixed the problem

#include <GUIConstants.au3>
#include <Misc.au3>
#include <File.au3>


$name = InputBox("Log In", "Please enter your name:")


GUICreate("Urbanyx", 400, 400)
GUISetIcon("C:\Program Files\AutoIt3\beta\Icons\au3.ico", 0)
TrayTip("Welcome to Urbanyx", "You are now logged into urbanyx.", 5, 1)



; MENU
$filem = GUICtrlCreateMenu("File")
GUICtrlCreateMenuItem("", $filem)
$exititem2 = GUICtrlCreateMenuItem("Exit", $filem)
$helpmenu = GUICtrlCreateMenu("About")
$aboutitem2 = GUICtrlCreateMenuItem("About", $helpmenu)



$s_TempFile = _TempFile()
InetGet("http://i36.tinypic.com/2wlzq6e.gif", $s_TempFile)

GUICtrlCreatePic($s_TempFile, 0, 0, 400, 100)
GUICtrlSetState( -1, $GUI_DISABLE)

; ABOUT
$label2 = GUICtrlCreateLabel("Logged in as:" & $name, 290, 29)
GUICtrlSetBkColor( -1, $GUI_BKCOLOR_TRANSPARENT )

$tab = GUICtrlCreateTab(5, 105, 390, 100)

$tab0 = GUICtrlCreateTabItem("tab0")
GUICtrlCreateLabel("lasdasd", 30, 130, 50, 20)

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label2", 30, 130, 50, 20)

$tab2 = GUICtrlCreateTabItem("tab2")
GUICtrlCreateLabel("label3", 30, 130, 50, 20)

GUICtrlCreateTabItem("") ; end tabitem definition

GUISetState()

While 1
    $msg = GUIGetMsg()

    If $msg = $exititem2 Or $msg = -3 Or $msg = -1 Then ExitLoop
    If $msg = $aboutitem2 Then MsgBox(0, "About", "Sample Menu coded by Dan http://sodadome.com")


WEnd

GUIDelete()

Exit

Admiral got there first... but missed one

GUICtrlSetBkColor( -1, $GUI_BKCOLOR_TRANSPARENT )

for the label

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
JavaScript_Freek

Thanks! Also, is there a way to make the background of the label white?


[center]Cookyx.com :: Simple LAN Chat[/center]

Share this post


Link to post
Share on other sites
AdmiralAlkex

-snipped-

Admiral got there first... but missed one

GUICtrlSetBkColor( -1, $GUI_BKCOLOR_TRANSPARENT )

for the label

8)

I saw it but I thought I would left something for he to fix himself ;) one of the best ways to learn stuff is to do them yourself!

Share this post


Link to post
Share on other sites
JavaScript_Freek

Whoa, didn't see Vault's post! Thanks you too!


[center]Cookyx.com :: Simple LAN Chat[/center]

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  

×