Sign in to follow this  
Followers 0
realkiller

label help

3 posts in this topic

i made a gui with a tab, next thing i added a label "hosts" and the number of host count. if i add new hosts the number will not increase, if i add host in the loop of the gui the nummers apear on all the tabs how can i update the numbers? anyone a idea

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

    
    $gui =GUICreate("Remote 4 Final",1000,800)  
    $tabcreate = GUICtrlCreateTab(0, 5, 840, 600)
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;------------------------setup--------------------------------Begin


    $1tabsetup = GUICtrlCreateTabItem("Setup")
$iExWindowStyle = BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE)
$iExListViewStyle = BitOR($LVS_EX_SUBITEMIMAGES, $LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES, $LVS_EX_DOUBLEBUFFER);$LVS_EX_FULLROWSELECT
    $hListView = GUICtrlCreateListView("", 35, 40, 730, 268,"", $iExWindowStyle)
    _GUICtrlListView_SetExtendedListViewStyle($hListView, $iExListViewStyle)
    _GUICtrlListView_AddColumn($hListView, "Hostname", 80)
    _GUICtrlListView_AddColumn($hListView, "Status", 80)
    _GUICtrlListView_AddColumn($hListView, "Mac-Adres", 110)
    _GUICtrlListView_AddColumn($hListView, "Logged On", 80)
    _GUICtrlListView_AddColumn($hListView, "Update %", 80)
    _GUICtrlListView_AddColumn($hListView, "Last Seen", 80)
    _GUICtrlListView_AddColumn($hListView, "Type", 80)
    _GUICtrlListView_AddColumn($hListView, "Serial Tag", 80)
    _GUICtrlListView_AddColumn($hListView, "OS", 80)
    
    _GUICtrlListView_AddItem($hListView, "Up443", 1)
    _GUICtrlListView_AddSubItem($hListView, 0, "Online", 1, 2)
    _GUICtrlListView_AddSubItem($hListView, 0, "7A-79-05-0F-17-53", 2, 3)
    _GUICtrlListView_AddSubItem($hListView, 0, "hebbbzerr", 3, 4)
    _GUICtrlListView_AddSubItem($hListView, 0, "70", 4, 5)
    _GUICtrlListView_AddSubItem($hListView, 0, "29-06-2008", 5, 6)
    _GUICtrlListView_AddSubItem($hListView, 0, "GX260", 6, 7)
    _GUICtrlListView_AddSubItem($hListView, 0, "123456", 7, 8)
    _GUICtrlListView_AddSubItem($hListView, 0, "XP", 8, 9)
    
        _GUICtrlListView_AddItem($hListView, "Up448", 2)
    _GUICtrlListView_AddSubItem($hListView, 1, "Online", 1, 2)
    _GUICtrlListView_AddSubItem($hListView, 1, "7A-79-05-0F-17-53", 2, 3)
    _GUICtrlListView_AddSubItem($hListView, 1, "hefff", 3, 4)
    _GUICtrlListView_AddSubItem($hListView, 1, "70", 4, 5)
    _GUICtrlListView_AddSubItem($hListView, 1, "29-06-2008", 5, 6)
    _GUICtrlListView_AddSubItem($hListView, 1, "GX280", 6, 7)
    _GUICtrlListView_AddSubItem($hListView, 1, "123456", 7, 8)
    _GUICtrlListView_AddSubItem($hListView, 1, "XP", 8, 9)


    $hListView1 = GUICtrlCreateListView("", 35, 320, 730, 268,"", $iExWindowStyle)
    _GUICtrlListView_SetExtendedListViewStyle($hListView1, $iExListViewStyle)
    _GUICtrlListView_AddColumn($hListView1, "Hostname", 80)
    _GUICtrlListView_AddColumn($hListView1, "Status", 80)
    _GUICtrlListView_AddColumn($hListView1, "Mac-Adres", 110)
    _GUICtrlListView_AddColumn($hListView1, "Logged On", 80)
    _GUICtrlListView_AddColumn($hListView1, "Update %", 80)
    _GUICtrlListView_AddColumn($hListView1, "Last Seen", 80)
    _GUICtrlListView_AddColumn($hListView1, "Type", 80)
    _GUICtrlListView_AddColumn($hListView1, "Serial Tag", 80)
    _GUICtrlListView_AddColumn($hListView1, "OS", 80)
    
$yy = _GUICtrlListView_GetItemCount($hListView1)
$y = _GUICtrlListView_GetItemCount($hListView)

GUICtrlCreateLabel("Hosts: "&$y, 770, 250,50)
GUICtrlCreateLabel("Hosts: "&$yy, 770, 360,50)  
;~  
    $copy= GUICtrlCreateButton("Transfer", 780, 300, 50,20)

    
    

    
    ;knoppen onder----
    $1Previous = GUICtrlCreateButton("<-Previous", 395, 760, 100)
    $1Next = GUICtrlCreateButton("Next->", 505, 760, 100)
    
    ;------------------------setup----------------------------------------end
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;------------------------output--------------------------------------Begin
    $2Send = GUICtrlCreateTabItem("Send")


    ;knoppen onder----
    $2Previous = GUICtrlCreateButton("<-Previous", 395, 760, 100)
    $2Next = GUICtrlCreateButton("Next->", 505, 760, 100)
    ;------------------------output----------------------------------------end
    ;-----------------------------------------------------------------
    ;-----------------------------------------------------------------
    ;-----------------------------------------------------------------
    ;-----------------------------------------------------------------
    ;------------------------Progress list--------------------------------Begin
    $3tabprogresslist = GUICtrlCreateTabItem("Progress list")

    
    
    ;knoppen onder----
    $3Previous = GUICtrlCreateButton("<-Previous", 395, 760, 100)
    $3Next = GUICtrlCreateButton("Next->", 505, 760, 100)
    ;------------------------Progress list--------------------------------end
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------
    ;----------------------------------------------------------------

    GUISetState(@SW_SHOW, $GUI)
While 1
$msg = GUIGetMsg()
;----------------------     



if $msg = $copy  Then
;Begin----------------------------------------------------------------copy + security
$yy = _GUICtrlListView_GetItemCount($hListView1)
$y = _GUICtrlListView_GetItemCount($hListView)  
if $yy = 0 Then
_GUICtrlListView_CopyItems($hListView, $hListView1) 
Else
$i = 0
Do
$checked = _GUICtrlListView_GetItemChecked($hListView, $i)
$text= _GUICtrlListView_GetItemText($hListView, $i)
$ii = 0
Do
$text1 = _GUICtrlListView_GetItemText($hListView1, $ii)
If  $text = $text1 Then
_GUICtrlListView_SetItemChecked($hListView, $i,False)
EndIf
$ii = $ii + 1
Until $ii = $yy
$i = $i + 1
Until $i = $y
_GUICtrlListView_CopyItems($hListView, $hListView1)
EndIf
$uncheck= 0
$uncheck1 = _GUICtrlListView_GetItemCount($hListView)
do 
_GUICtrlListView_SetItemChecked($hListView, $uncheck,False)
$uncheck = $uncheck + 1
Until $uncheck = $uncheck1
;End----------------------------------------------------------------copy + security
EndIf



if $msg = $1Next then GUICtrlSetState($2Send, $GUI_SHOW)
if $msg = $2Next then GUICtrlSetState($3tabprogresslist, $GUI_SHOW)
if $msg = $3Next then GUICtrlSetState($1tabsetup, $GUI_SHOW)
if $msg = $1Previous then GUICtrlSetState($3tabprogresslist, $GUI_SHOW)
if $msg = $3Previous then GUICtrlSetState($2Send, $GUI_SHOW)
if $msg = $2Previous then GUICtrlSetState($1tabsetup, $GUI_SHOW)

;---------------------- 
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

To change label use GUICtrlSetData()

$Label = GUICtrlCreateLabel("Hosts: "&$yy, 770, 360,50) 
GUICtrlSetData($Label,1)
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

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