Jump to content

Need help to get a Graphic to the front


Recommended Posts

Can anyone help me with my script?

i know whats the problem but it dont wanna work..

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Opt('MustDeclareVars', 1)




Remote()

Func Remote()
    Local $gui, $background, $msg, $tab, $net1, $ip1, $online1, $tab2, $basti_stay, $button1, $button2, $button3, $button4, $button5, $button6, $button7, $button8, $button9, $button10, $button11, $button12, $button13, $button14, $button15, $button16, $button17, $button18, $button19, $button20, $button21, $button22, $button23, $button24, $button25, $button26, $button27, $button28, $button29, $button30, $button31, $button32, $button33, $button34, $button35, $button36, $button37, $button38, $button39, $button40, $button41, $button42, $button43, $button44, $button45, $button46, $button47, $button48, $button49, $button50

    $gui = GUICreate("Remote", 800, 595)
    $tab = GUICtrlCreateTab(0, 0, 800, 595) (When i disable this it works)
    $tab2 = GUICtrlCreateTabItem("Beneden") (When i disable this it works)
    $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\beneden.bmp", 6, 25, 788, 564) (When i disable this it works)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

    $ip1  = "192.168.3.10"
    $online1 = Ping($ip1,1)

    $net1 = GUICtrlCreateGraphic(10,20,20,10) (this needs to be on the front)
    GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 0,0, 11,11)(this needs to be on the front)


    $button1 = GUICtrlCreateButton ("V",  307, 45, 15, 16)
    $button2 = GUICtrlCreateButton ("C",  324, 45, 15, 16)

    $button3 = GUICtrlCreateButton ("V",  374, 45, 15, 16)
    $button4 = GUICtrlCreateButton ("C",  391, 45, 15, 16)

    $button5 = GUICtrlCreateButton ("V",  428, 45, 15, 16)
    $button6 = GUICtrlCreateButton ("C",  445, 45, 15, 16)

    $button7 = GUICtrlCreateButton ("V",  307, 191, 15, 16)
    $button8 = GUICtrlCreateButton ("C",  324, 191, 15, 16)

    $button9 = GUICtrlCreateButton ("V",  381, 106, 15, 16)
    $button10 = GUICtrlCreateButton ("C",  398, 106, 15, 16)

    $button11 = GUICtrlCreateButton ("V",  484, 45, 15, 16)
    $button12 = GUICtrlCreateButton ("C",  501, 45, 15, 16)

    $button13 = GUICtrlCreateButton ("V",  550, 45, 15, 16)
    $button14 = GUICtrlCreateButton ("C",  567, 45, 15, 16)

    $button15 = GUICtrlCreateButton ("V",  484, 114, 15, 16)
    $button16 = GUICtrlCreateButton ("C",  501, 114, 15, 16)

    $button17 = GUICtrlCreateButton ("V",  550, 114, 15, 16)
    $button18 = GUICtrlCreateButton ("C",  567, 114, 15, 16)

    $button19 = GUICtrlCreateButton ("V",  607, 45, 15, 16)
    $button20 = GUICtrlCreateButton ("C",  624, 45, 15, 16)

    $button21 = GUICtrlCreateButton ("V",  709, 45, 15, 16)
    $button22 = GUICtrlCreateButton ("C",  726, 45, 15, 16)

    $button23 = GUICtrlCreateButton ("V",  709, 114, 15, 16)
    $button24 = GUICtrlCreateButton ("C",  726, 114, 15, 16)

    $button25 = GUICtrlCreateButton ("V",  709, 159, 15, 16)
    $button26 = GUICtrlCreateButton ("C",  726, 159, 15, 16)

    $button27 = GUICtrlCreateButton ("V",  709, 205, 15, 16)
    $button28 = GUICtrlCreateButton ("C",  726, 205, 15, 16)

    $button29 = GUICtrlCreateButton ("V",  343, 484, 15, 16)
    $button30 = GUICtrlCreateButton ("C",  360, 484, 15, 16)

    $button31 = GUICtrlCreateButton ("V",  339, 524, 15, 16)
    $button32 = GUICtrlCreateButton ("C",  356, 524, 15, 16)

    $button33 = GUICtrlCreateButton ("V",  381, 524, 15, 16)
    $button34 = GUICtrlCreateButton ("C",  398, 524, 15, 16)

    $button35 = GUICtrlCreateButton ("V",  432, 520, 15, 16)
    $button36 = GUICtrlCreateButton ("C",  449, 520, 15, 16)

    $button37 = GUICtrlCreateButton ("V",  432, 563, 15, 16)
    $button38 = GUICtrlCreateButton ("C",  449, 563, 15, 16)

    $button39 = GUICtrlCreateButton ("V",  544, 376, 15, 16)
    $button40 = GUICtrlCreateButton ("C",  561, 376, 15, 16)

    $button41 = GUICtrlCreateButton ("V",  544, 499, 15, 16)
    $button42 = GUICtrlCreateButton ("C",  561, 499, 15, 16)

    $button43 = GUICtrlCreateButton ("V",  644, 376, 15, 16)
    $button44 = GUICtrlCreateButton ("C",  661, 376, 15, 16)

    $button45 = GUICtrlCreateButton ("V",  644, 499, 15, 16)
    $button46 = GUICtrlCreateButton ("C",  661, 499, 15, 16)

    $button47 = GUICtrlCreateButton ("V",  739, 376, 15, 16)
    $button48 = GUICtrlCreateButton ("C",  756, 376, 15, 16)

    $button49 = GUICtrlCreateButton ("V",  739, 499, 15, 16)
    $button50 = GUICtrlCreateButton ("C",  756, 499, 15, 16)

        If $online1 > 0 Then
        MsgBox(64,"test","test")
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0x00ff00, 0x00ff00)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 100,2, 20,20)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    Else
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 10,10, 10,10)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    EndIf

;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Boven")
;~  GUICtrlSetState(2, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)





;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Handelshuis")
;~  GUICtrlSetState(3, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)



    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2
Edited by Lightning87
Link to comment
Share on other sites

  • Moderators

Lightning87,

First, welcome to the AutoIt forums. A good start - some code to work on and a clear question. I wish some other newcomers would do the same.

However, your code does not copy and paste properly and I am not going to add all the missing carriage returns manually! :)

Please repost it using code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here).

Then we can look at what is wrong.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Opt('MustDeclareVars', 1)

Remote()

; Remote
Func Remote()
    Local $gui, $background, $msg, $tab, $tab2, $basti_stay, $button1, $button2, $button3, $button4, $button5, $button6, $button7, $button8, $button9, $button10, $button11, $button12, $button13, $button14, $button15, $button16, $button17, $button18, $button19, $button20, $button21, $button22, $button23, $button24, $button25, $button26, $button27, $button28, $button29, $button30, $button31, $button32, $button33, $button34, $button35, $button36, $button37, $button38, $button39, $button40, $button41, $button42, $button43, $button44, $button45, $button46, $button47, $button48, $button49, $button50

    $gui = GUICreate("Remote", 800, 595)


    $tab = GUICtrlCreateTab(0, 0, 800, 595)
    $tab2 = GUICtrlCreateTabItem("Beneden")

    $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\beneden.bmp", 6, 25, 788, 564)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)


    $button1 = GUICtrlCreateButton ("V",  307, 45, 15, 16)
    $button2 = GUICtrlCreateButton ("C",  324, 45, 15, 16)

    $button3 = GUICtrlCreateButton ("V",  374, 45, 15, 16)
    $button4 = GUICtrlCreateButton ("C",  391, 45, 15, 16)

    $button5 = GUICtrlCreateButton ("V",  428, 45, 15, 16)
    $button6 = GUICtrlCreateButton ("C",  445, 45, 15, 16)

    $button7 = GUICtrlCreateButton ("V",  307, 191, 15, 16)
    $button8 = GUICtrlCreateButton ("C",  324, 191, 15, 16)

    $button9 = GUICtrlCreateButton ("V",  381, 106, 15, 16)
    $button10 = GUICtrlCreateButton ("C",  398, 106, 15, 16)

    $button11 = GUICtrlCreateButton ("V",  484, 45, 15, 16)
    $button12 = GUICtrlCreateButton ("C",  501, 45, 15, 16)

    $button13 = GUICtrlCreateButton ("V",  550, 45, 15, 16)
    $button14 = GUICtrlCreateButton ("C",  567, 45, 15, 16)

    $button15 = GUICtrlCreateButton ("V",  484, 114, 15, 16)
    $button16 = GUICtrlCreateButton ("C",  501, 114, 15, 16)

    $button17 = GUICtrlCreateButton ("V",  550, 114, 15, 16)
    $button18 = GUICtrlCreateButton ("C",  567, 114, 15, 16)

    $button19 = GUICtrlCreateButton ("V",  607, 45, 15, 16)
    $button20 = GUICtrlCreateButton ("C",  624, 45, 15, 16)

    $button21 = GUICtrlCreateButton ("V",  709, 45, 15, 16)
    $button22 = GUICtrlCreateButton ("C",  726, 45, 15, 16)

    $button23 = GUICtrlCreateButton ("V",  709, 114, 15, 16)
    $button24 = GUICtrlCreateButton ("C",  726, 114, 15, 16)

    $button25 = GUICtrlCreateButton ("V",  709, 159, 15, 16)
    $button26 = GUICtrlCreateButton ("C",  726, 159, 15, 16)

    $button27 = GUICtrlCreateButton ("V",  709, 205, 15, 16)
    $button28 = GUICtrlCreateButton ("C",  726, 205, 15, 16)

    $button29 = GUICtrlCreateButton ("V",  343, 484, 15, 16)
    $button30 = GUICtrlCreateButton ("C",  360, 484, 15, 16)

    $button31 = GUICtrlCreateButton ("V",  339, 524, 15, 16)
    $button32 = GUICtrlCreateButton ("C",  356, 524, 15, 16)

    $button33 = GUICtrlCreateButton ("V",  381, 524, 15, 16)
    $button34 = GUICtrlCreateButton ("C",  398, 524, 15, 16)

    $button35 = GUICtrlCreateButton ("V",  432, 520, 15, 16)
    $button36 = GUICtrlCreateButton ("C",  449, 520, 15, 16)

    $button37 = GUICtrlCreateButton ("V",  432, 563, 15, 16)
    $button38 = GUICtrlCreateButton ("C",  449, 563, 15, 16)

    $button39 = GUICtrlCreateButton ("V",  544, 376, 15, 16)
    $button40 = GUICtrlCreateButton ("C",  561, 376, 15, 16)

    $button41 = GUICtrlCreateButton ("V",  544, 499, 15, 16)
    $button42 = GUICtrlCreateButton ("C",  561, 499, 15, 16)

    $button43 = GUICtrlCreateButton ("V",  644, 376, 15, 16)
    $button44 = GUICtrlCreateButton ("C",  661, 376, 15, 16)

    $button45 = GUICtrlCreateButton ("V",  644, 499, 15, 16)
    $button46 = GUICtrlCreateButton ("C",  661, 499, 15, 16)

    $button47 = GUICtrlCreateButton ("V",  739, 376, 15, 16)
    $button48 = GUICtrlCreateButton ("C",  756, 376, 15, 16)

    $button49 = GUICtrlCreateButton ("V",  739, 499, 15, 16)
    $button50 = GUICtrlCreateButton ("C",  756, 499, 15, 16)








;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Boven")
;~  GUICtrlSetState(2, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)





;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Handelshuis")
;~  GUICtrlSetState(3, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)



    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2

Thank you for reply!

You mean like this?

Link to comment
Share on other sites

  • Moderators

Lightning87,

Yes, now I can copy it. But it is not the same script?

M23

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Oops im so stupid :S

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Opt('MustDeclareVars', 1)




Remote()

Func Remote()
    Local $gui, $background, $msg, $tab, $net1, $ip1, $online1, $tab2, $basti_stay, $button1, $button2, $button3, $button4, $button5, $button6, $button7, $button8, $button9, $button10, $button11, $button12, $button13, $button14, $button15, $button16, $button17, $button18, $button19, $button20, $button21, $button22, $button23, $button24, $button25, $button26, $button27, $button28, $button29, $button30, $button31, $button32, $button33, $button34, $button35, $button36, $button37, $button38, $button39, $button40, $button41, $button42, $button43, $button44, $button45, $button46, $button47, $button48, $button49, $button50

    $gui = GUICreate("Remote", 800, 595)
;~  $tab = GUICtrlCreateTab(0, 0, 800, 595)
;~  $tab2 = GUICtrlCreateTabItem("Beneden")
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\beneden.bmp", 6, 25, 788, 564)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

;~  $ip1  = "192.168.3.10"
;~  $online1 = Ping($ip1,1)

    $net1 = GUICtrlCreateGraphic(10,20,20,10)
    GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 0,0, 11,11)


    $button1 = GUICtrlCreateButton ("V",  307, 45, 15, 16)
    $button2 = GUICtrlCreateButton ("C",  324, 45, 15, 16)

    $button3 = GUICtrlCreateButton ("V",  374, 45, 15, 16)
    $button4 = GUICtrlCreateButton ("C",  391, 45, 15, 16)

    $button5 = GUICtrlCreateButton ("V",  428, 45, 15, 16)
    $button6 = GUICtrlCreateButton ("C",  445, 45, 15, 16)

    $button7 = GUICtrlCreateButton ("V",  307, 191, 15, 16)
    $button8 = GUICtrlCreateButton ("C",  324, 191, 15, 16)

    $button9 = GUICtrlCreateButton ("V",  381, 106, 15, 16)
    $button10 = GUICtrlCreateButton ("C",  398, 106, 15, 16)

    $button11 = GUICtrlCreateButton ("V",  484, 45, 15, 16)
    $button12 = GUICtrlCreateButton ("C",  501, 45, 15, 16)

    $button13 = GUICtrlCreateButton ("V",  550, 45, 15, 16)
    $button14 = GUICtrlCreateButton ("C",  567, 45, 15, 16)

    $button15 = GUICtrlCreateButton ("V",  484, 114, 15, 16)
    $button16 = GUICtrlCreateButton ("C",  501, 114, 15, 16)

    $button17 = GUICtrlCreateButton ("V",  550, 114, 15, 16)
    $button18 = GUICtrlCreateButton ("C",  567, 114, 15, 16)

    $button19 = GUICtrlCreateButton ("V",  607, 45, 15, 16)
    $button20 = GUICtrlCreateButton ("C",  624, 45, 15, 16)

    $button21 = GUICtrlCreateButton ("V",  709, 45, 15, 16)
    $button22 = GUICtrlCreateButton ("C",  726, 45, 15, 16)

    $button23 = GUICtrlCreateButton ("V",  709, 114, 15, 16)
    $button24 = GUICtrlCreateButton ("C",  726, 114, 15, 16)

    $button25 = GUICtrlCreateButton ("V",  709, 159, 15, 16)
    $button26 = GUICtrlCreateButton ("C",  726, 159, 15, 16)

    $button27 = GUICtrlCreateButton ("V",  709, 205, 15, 16)
    $button28 = GUICtrlCreateButton ("C",  726, 205, 15, 16)

    $button29 = GUICtrlCreateButton ("V",  343, 484, 15, 16)
    $button30 = GUICtrlCreateButton ("C",  360, 484, 15, 16)

    $button31 = GUICtrlCreateButton ("V",  339, 524, 15, 16)
    $button32 = GUICtrlCreateButton ("C",  356, 524, 15, 16)

    $button33 = GUICtrlCreateButton ("V",  381, 524, 15, 16)
    $button34 = GUICtrlCreateButton ("C",  398, 524, 15, 16)

    $button35 = GUICtrlCreateButton ("V",  432, 520, 15, 16)
    $button36 = GUICtrlCreateButton ("C",  449, 520, 15, 16)

    $button37 = GUICtrlCreateButton ("V",  432, 563, 15, 16)
    $button38 = GUICtrlCreateButton ("C",  449, 563, 15, 16)

    $button39 = GUICtrlCreateButton ("V",  544, 376, 15, 16)
    $button40 = GUICtrlCreateButton ("C",  561, 376, 15, 16)

    $button41 = GUICtrlCreateButton ("V",  544, 499, 15, 16)
    $button42 = GUICtrlCreateButton ("C",  561, 499, 15, 16)

    $button43 = GUICtrlCreateButton ("V",  644, 376, 15, 16)
    $button44 = GUICtrlCreateButton ("C",  661, 376, 15, 16)

    $button45 = GUICtrlCreateButton ("V",  644, 499, 15, 16)
    $button46 = GUICtrlCreateButton ("C",  661, 499, 15, 16)

    $button47 = GUICtrlCreateButton ("V",  739, 376, 15, 16)
    $button48 = GUICtrlCreateButton ("C",  756, 376, 15, 16)

    $button49 = GUICtrlCreateButton ("V",  739, 499, 15, 16)
    $button50 = GUICtrlCreateButton ("C",  756, 499, 15, 16)

        If $online1 > 0 Then
        MsgBox(64,"test","test")
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0x00ff00, 0x00ff00)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 100,2, 20,20)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    Else
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 10,10, 10,10)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    EndIf

;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Boven")
;~  GUICtrlSetState(2, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)





;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Handelshuis")
;~  GUICtrlSetState(3, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)



    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2
Edited by Lightning87
Link to comment
Share on other sites

  • Moderators

Lightning87,

It looks as if you cannot create a Graphic control on a Tab. Tabs are peculiar beasts and often cause problems. But do not lose all hope, a real expert might come along in a while with solution.

In the meantime, how about trying to work around the problem by moving the graphic outside the Tab?

#include <GUIConstantsEx.au3>

; Create GUI
$hGUI = GUICreate("Test", 500, 500)

; Create graphic
$hGraph_1 = GUICtrlCreateGraphic(10,20,20,10)
GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0,0, 11,11)

; Create tabs
GUICtrlCreateTab(20, 40, 470, 450)
GUICtrlCreateTabItem("Fred")

GUICtrlCreateTabItem("")    ; end tabitem definition

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

You need some lateral thinking sometimes!

M23

P.S. And you need to close your TabItem definition - I have added the code. :)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 month later...

Lightning87,

Can anyone help me with my script?

i know whats the problem but it dont wanna work..

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Opt('MustDeclareVars', 1)




Remote()

Func Remote()
    Local $gui, $background, $msg, $tab, $net1, $ip1, $online1, $tab2, $basti_stay, $button1, $button2, $button3, $button4, $button5, $button6, $button7, $button8, $button9, $button10, $button11, $button12, $button13, $button14, $button15, $button16, $button17, $button18, $button19, $button20, $button21, $button22, $button23, $button24, $button25, $button26, $button27, $button28, $button29, $button30, $button31, $button32, $button33, $button34, $button35, $button36, $button37, $button38, $button39, $button40, $button41, $button42, $button43, $button44, $button45, $button46, $button47, $button48, $button49, $button50

    $gui = GUICreate("Remote", 800, 595)
    $tab = GUICtrlCreateTab(0, 0, 800, 595) (When i disable this it works)
    $tab2 = GUICtrlCreateTabItem("Beneden") (When i disable this it works)
    $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\beneden.bmp", 6, 25, 788, 564) (When i disable this it works)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

    $ip1  = "192.168.3.10"
    $online1 = Ping($ip1,1)

    $net1 = GUICtrlCreateGraphic(10,20,20,10) (this needs to be on the front)
    GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 0,0, 11,11)(this needs to be on the front)


    $button1 = GUICtrlCreateButton ("V",  307, 45, 15, 16)
    $button2 = GUICtrlCreateButton ("C",  324, 45, 15, 16)

    $button3 = GUICtrlCreateButton ("V",  374, 45, 15, 16)
    $button4 = GUICtrlCreateButton ("C",  391, 45, 15, 16)

    $button5 = GUICtrlCreateButton ("V",  428, 45, 15, 16)
    $button6 = GUICtrlCreateButton ("C",  445, 45, 15, 16)

    $button7 = GUICtrlCreateButton ("V",  307, 191, 15, 16)
    $button8 = GUICtrlCreateButton ("C",  324, 191, 15, 16)

    $button9 = GUICtrlCreateButton ("V",  381, 106, 15, 16)
    $button10 = GUICtrlCreateButton ("C",  398, 106, 15, 16)

    $button11 = GUICtrlCreateButton ("V",  484, 45, 15, 16)
    $button12 = GUICtrlCreateButton ("C",  501, 45, 15, 16)

    $button13 = GUICtrlCreateButton ("V",  550, 45, 15, 16)
    $button14 = GUICtrlCreateButton ("C",  567, 45, 15, 16)

    $button15 = GUICtrlCreateButton ("V",  484, 114, 15, 16)
    $button16 = GUICtrlCreateButton ("C",  501, 114, 15, 16)

    $button17 = GUICtrlCreateButton ("V",  550, 114, 15, 16)
    $button18 = GUICtrlCreateButton ("C",  567, 114, 15, 16)

    $button19 = GUICtrlCreateButton ("V",  607, 45, 15, 16)
    $button20 = GUICtrlCreateButton ("C",  624, 45, 15, 16)

    $button21 = GUICtrlCreateButton ("V",  709, 45, 15, 16)
    $button22 = GUICtrlCreateButton ("C",  726, 45, 15, 16)

    $button23 = GUICtrlCreateButton ("V",  709, 114, 15, 16)
    $button24 = GUICtrlCreateButton ("C",  726, 114, 15, 16)

    $button25 = GUICtrlCreateButton ("V",  709, 159, 15, 16)
    $button26 = GUICtrlCreateButton ("C",  726, 159, 15, 16)

    $button27 = GUICtrlCreateButton ("V",  709, 205, 15, 16)
    $button28 = GUICtrlCreateButton ("C",  726, 205, 15, 16)

    $button29 = GUICtrlCreateButton ("V",  343, 484, 15, 16)
    $button30 = GUICtrlCreateButton ("C",  360, 484, 15, 16)

    $button31 = GUICtrlCreateButton ("V",  339, 524, 15, 16)
    $button32 = GUICtrlCreateButton ("C",  356, 524, 15, 16)

    $button33 = GUICtrlCreateButton ("V",  381, 524, 15, 16)
    $button34 = GUICtrlCreateButton ("C",  398, 524, 15, 16)

    $button35 = GUICtrlCreateButton ("V",  432, 520, 15, 16)
    $button36 = GUICtrlCreateButton ("C",  449, 520, 15, 16)

    $button37 = GUICtrlCreateButton ("V",  432, 563, 15, 16)
    $button38 = GUICtrlCreateButton ("C",  449, 563, 15, 16)

    $button39 = GUICtrlCreateButton ("V",  544, 376, 15, 16)
    $button40 = GUICtrlCreateButton ("C",  561, 376, 15, 16)

    $button41 = GUICtrlCreateButton ("V",  544, 499, 15, 16)
    $button42 = GUICtrlCreateButton ("C",  561, 499, 15, 16)

    $button43 = GUICtrlCreateButton ("V",  644, 376, 15, 16)
    $button44 = GUICtrlCreateButton ("C",  661, 376, 15, 16)

    $button45 = GUICtrlCreateButton ("V",  644, 499, 15, 16)
    $button46 = GUICtrlCreateButton ("C",  661, 499, 15, 16)

    $button47 = GUICtrlCreateButton ("V",  739, 376, 15, 16)
    $button48 = GUICtrlCreateButton ("C",  756, 376, 15, 16)

    $button49 = GUICtrlCreateButton ("V",  739, 499, 15, 16)
    $button50 = GUICtrlCreateButton ("C",  756, 499, 15, 16)

        If $online1 > 0 Then
        MsgBox(64,"test","test")
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0x00ff00, 0x00ff00)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 100,2, 20,20)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    Else
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 10,10, 10,10)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    EndIf

;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Boven")
;~  GUICtrlSetState(2, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)





;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Handelshuis")
;~  GUICtrlSetState(3, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)



    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2

Better late than never... Almost a month!

Your script below is modified so that it can set the GUICtrlCreateGraphic in front of the tab.

Example:

$net1 = GUICtrlCreateGraphic(10,30,11,11) ;(this needs to be on the front)
    GUICtrlSetState(-1, $GUI_ONTOP) ; sets the Graphic and the Ellipse on the front
    GUICtrlSetBkColor(-1, 0xFBF7F4)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0x00FF00) ; Green
    GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 0,0, 11,11) ;(this needs to be on the front)

Full Code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


Opt('MustDeclareVars', 1)




Remote()

Func Remote()
    Local $gui, $background, $msg, $tab, $net1, $ip1, $online1, $tab2, $basti_stay, $button1, $button2, $button3, $button4, $button5, $button6, $button7, $button8, $button9, $button10, $button11, $button12, $button13, $button14, $button15, $button16, $button17, $button18, $button19, $button20, $button21, $button22, $button23, $button24, $button25, $button26, $button27, $button28, $button29, $button30, $button31, $button32, $button33, $button34, $button35, $button36, $button37, $button38, $button39, $button40, $button41, $button42, $button43, $button44, $button45, $button46, $button47, $button48, $button49, $button50

    $gui = GUICreate("Remote", 800, 595)
    $tab = GUICtrlCreateTab(0, 0, 800, 595) ;(When i disable this it works)
    $tab2 = GUICtrlCreateTabItem("Beneden") ;(When i disable this it works)
    $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\beneden.bmp", 6, 25, 788, 564) ;(When i disable this it works)
    GuiCtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

    $ip1  = "192.168.3.10"
    $online1 = Ping($ip1,1)

    $net1 = GUICtrlCreateGraphic(10,30,11,11) ;(this needs to be on the front)
    GUICtrlSetState(-1, $GUI_ONTOP)
    GUICtrlSetBkColor(-1, 0xFBF7F4)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0x00FF00) ; Green
    GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 0,0, 11,11) ;(this needs to be on the front)


    $button1 = GUICtrlCreateButton ("V",  307, 45, 15, 16)
    $button2 = GUICtrlCreateButton ("C",  324, 45, 15, 16)

    $button3 = GUICtrlCreateButton ("V",  374, 45, 15, 16)
    $button4 = GUICtrlCreateButton ("C",  391, 45, 15, 16)

    $button5 = GUICtrlCreateButton ("V",  428, 45, 15, 16)
    $button6 = GUICtrlCreateButton ("C",  445, 45, 15, 16)

    $button7 = GUICtrlCreateButton ("V",  307, 191, 15, 16)
    $button8 = GUICtrlCreateButton ("C",  324, 191, 15, 16)

    $button9 = GUICtrlCreateButton ("V",  381, 106, 15, 16)
    $button10 = GUICtrlCreateButton ("C",  398, 106, 15, 16)

    $button11 = GUICtrlCreateButton ("V",  484, 45, 15, 16)
    $button12 = GUICtrlCreateButton ("C",  501, 45, 15, 16)

    $button13 = GUICtrlCreateButton ("V",  550, 45, 15, 16)
    $button14 = GUICtrlCreateButton ("C",  567, 45, 15, 16)

    $button15 = GUICtrlCreateButton ("V",  484, 114, 15, 16)
    $button16 = GUICtrlCreateButton ("C",  501, 114, 15, 16)

    $button17 = GUICtrlCreateButton ("V",  550, 114, 15, 16)
    $button18 = GUICtrlCreateButton ("C",  567, 114, 15, 16)

    $button19 = GUICtrlCreateButton ("V",  607, 45, 15, 16)
    $button20 = GUICtrlCreateButton ("C",  624, 45, 15, 16)

    $button21 = GUICtrlCreateButton ("V",  709, 45, 15, 16)
    $button22 = GUICtrlCreateButton ("C",  726, 45, 15, 16)

    $button23 = GUICtrlCreateButton ("V",  709, 114, 15, 16)
    $button24 = GUICtrlCreateButton ("C",  726, 114, 15, 16)

    $button25 = GUICtrlCreateButton ("V",  709, 159, 15, 16)
    $button26 = GUICtrlCreateButton ("C",  726, 159, 15, 16)

    $button27 = GUICtrlCreateButton ("V",  709, 205, 15, 16)
    $button28 = GUICtrlCreateButton ("C",  726, 205, 15, 16)

    $button29 = GUICtrlCreateButton ("V",  343, 484, 15, 16)
    $button30 = GUICtrlCreateButton ("C",  360, 484, 15, 16)

    $button31 = GUICtrlCreateButton ("V",  339, 524, 15, 16)
    $button32 = GUICtrlCreateButton ("C",  356, 524, 15, 16)

    $button33 = GUICtrlCreateButton ("V",  381, 524, 15, 16)
    $button34 = GUICtrlCreateButton ("C",  398, 524, 15, 16)

    $button35 = GUICtrlCreateButton ("V",  432, 520, 15, 16)
    $button36 = GUICtrlCreateButton ("C",  449, 520, 15, 16)

    $button37 = GUICtrlCreateButton ("V",  432, 563, 15, 16)
    $button38 = GUICtrlCreateButton ("C",  449, 563, 15, 16)

    $button39 = GUICtrlCreateButton ("V",  544, 376, 15, 16)
    $button40 = GUICtrlCreateButton ("C",  561, 376, 15, 16)

    $button41 = GUICtrlCreateButton ("V",  544, 499, 15, 16)
    $button42 = GUICtrlCreateButton ("C",  561, 499, 15, 16)

    $button43 = GUICtrlCreateButton ("V",  644, 376, 15, 16)
    $button44 = GUICtrlCreateButton ("C",  661, 376, 15, 16)

    $button45 = GUICtrlCreateButton ("V",  644, 499, 15, 16)
    $button46 = GUICtrlCreateButton ("C",  661, 499, 15, 16)

    $button47 = GUICtrlCreateButton ("V",  739, 376, 15, 16)
    $button48 = GUICtrlCreateButton ("C",  756, 376, 15, 16)

    $button49 = GUICtrlCreateButton ("V",  739, 499, 15, 16)
    $button50 = GUICtrlCreateButton ("C",  756, 499, 15, 16)

        If $online1 > 0 Then
        MsgBox(64,"test","test")
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0x00ff00, 0x00ff00)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 100,2, 20,20)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    Else
        GUICtrlSetGraphic($net1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
        GUICtrlSetGraphic($net1, $GUI_GR_ELLIPSE, 10,10, 10,10)
        GUICtrlSetGraphic($net1, $GUI_GR_REFRESH)
    EndIf

;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Boven")
;~  GUICtrlSetState(2, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)





;~  $tab = GUICtrlCreateTab(25, 0, 800, 600)
;~  $tab2 = GUICtrlCreateTabItem("Handelshuis")
;~  GUICtrlSetState(3, $GUI_SHOW)   ; will be display first
;~  $basti_stay = GUICtrlCreatePic(@SystemDir & "\oobe\images\boven.bmp", 6, 25, 788, 564)
;~  GuiCtrlSetState(-1, $GUI_DISABLE)
;~  GUISetState(@SW_SHOW)

GUICtrlCreateTabItem("")    ; end tabitem definition


    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2

jfcby

Edited by jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...