Jump to content
Sign in to follow this  
gcue

using guictrlcreatelabel as statusbar (lame i know)

Recommended Posts

gcue

i have a child window which im using guictrlcreatelabel to show that status of a process

process=pinging an ip range

so im doing:

GUICtrlCreateLabel("Checking " & $ip & "         ", 10, 50)

as you can imagine.. this is output is very ugly any alternate solutions?

thanks.

Share this post


Link to post
Share on other sites
azure

i have a child window which im using guictrlcreatelabel to show that status of a process

process=pinging an ip range

so im doing:

GUICtrlCreateLabel("Checking " & $ip & "         ", 10, 50)

as you can imagine.. this is output is very ugly any alternate solutions?

thanks.

I personally like having a listview and using it as a scrolling log window, basically. Just GUICtrlSetData each time you append something to it.

Share this post


Link to post
Share on other sites
gcue

can you show me an example?

thanks =)

Share this post


Link to post
Share on other sites
Aceguy

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

$Form1 = GUICreate("Form1", 238, 145, 193, 125)
$Label1 = GUICtrlCreateLabel("Label1", 16, 40, 100, 25)
GUISetState(@SW_SHOW)


for $c = 1 to 10
    $rnd=Random(0,500,0)
    GUICtrlSetData($Label1,$rnd)
    sleep(500)
Next
sleep(1000)oÝ÷ ÚÚºÚ"µÍÚ[ÛYH   ÑÕRPÛÛÝ[Ñ^]LÉÝÂÚ[ÛYH ÔÝ]XÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH    ÕÚ[ÝÜÐÛÛÝ[Ë]LÉÝÂÌÍÑÜLHHÕRPÜX]J    ][ÝÑÜLI][ÝË
BÌÍÓX[HHÕRPÝÜX]SÝ
    ][ÝÓX[I][ÝËLLNN
BÕRTÙ]Ý]JÕ×ÔÒÕÊBÜ ÌÍØÈHHÈLIÌÍÜT[ÛJ
L
BQÕRPÝÙ]]J   ÌÍÓX[K   ÌÍÜ
BÛY
L
B^ÛY
L

Edited by Aceguy

Share this post


Link to post
Share on other sites
azure

can you show me an example?

thanks =)

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

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1",218, 240, 0, 0)
$List1 = GUICtrlCreateList("", 0, 0, 217, 214, BitOr(0x4000,0x00200000))
$Button1 = GUICtrlCreateButton("Run Script", 0, 217, 214, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            RunMe()
    EndSwitch
WEnd

Func RunMe()
For $i = 1 To 50
    ;Do Something
    $msg = "Line "&$i&": I just did something here. YAY!"
    GUICtrlSetData($List1,$msg)
    ControlCommand("Form1","","[CLASS:ListBox; INSTANCE:1]","SelectString",$msg)
    Sleep(100)
Next
MsgBox(0,"","Exiting Script")
Exit
EndFunc

Share this post


Link to post
Share on other sites
gcue

thank you!

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

$Form1 = GUICreate("Form1", 238, 145, 193, 125)
$Label1 = GUICtrlCreateLabel("Label1", 16, 40, 100, 25)
GUISetState(@SW_SHOW)


for $c = 1 to 10
    $rnd=Random(0,500,0)
    GUICtrlSetData($Label1,$rnd)
    sleep(500)
Next
sleep(1000)oÝ÷ ÚÚºÚ"µÍÚ[ÛYH   ÑÕRPÛÛÝ[Ñ^]LÉÝÂÚ[ÛYH ÔÝ]XÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH    ÕÚ[ÝÜÐÛÛÝ[Ë]LÉÝÂÌÍÑÜLHHÕRPÜX]J    ][ÝÑÜLI][ÝË
BÌÍÓX[HHÕRPÝÜX]SÝ
    ][ÝÓX[I][ÝËLLNN
BÕRTÙ]Ý]JÕ×ÔÒÕÊBÜ ÌÍØÈHHÈLIÌÍÜT[ÛJ
L
BQÕRPÝÙ]]J   ÌÍÓX[K   ÌÍÜ
BÛY

L
B^ÛY
L

Share this post


Link to post
Share on other sites
gcue

thank you!

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

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1",218, 240, 0, 0)
$List1 = GUICtrlCreateList("", 0, 0, 217, 214, BitOr(0x4000,0x00200000))
$Button1 = GUICtrlCreateButton("Run Script", 0, 217, 214, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            RunMe()
    EndSwitch
WEnd

Func RunMe()
For $i = 1 To 50
    ;Do Something
    $msg = "Line "&$i&": I just did something here. YAY!"
    GUICtrlSetData($List1,$msg)
    ControlCommand("Form1","","[CLASS:ListBox; INSTANCE:1]","SelectString",$msg)
    Sleep(100)
Next
MsgBox(0,"","Exiting Script")
Exit
EndFunc

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  

×