Sign in to follow this  
Followers 0
youtuber

Two label to data transfer?

7 posts in this topic

Hi, How to transfer data two labels?

GUICtrlSetData($Label1,$Label2, $var[0])

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@youtuber, if you're trying to set the value of a label, you would do so like this. If you are looking to do something else, maybe more than a 6 word explanation ;)

 

GUICtrlSetData($label1, $var[0])
GUICtrlSetData($label2, $var[0])

 

Edited by JLogan3o13
1 person likes this

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

You cannot set data for a label this way - only gradually.

GUICtrlSetData($Label1, $var[0])
GUICtrlSetData($Label2, $var[0])

 

1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites
2 minutes ago, JLogan3o13 said:

maybe more than a 6 word explanation

A lack of language skills but he is trying. :thumbsup:

2 people like this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

Then put your labels in an array, and do something like this:

For $sLabel In $aLabels
   GUICtrlSetData($sLabel, $var[0])
Next

 

1 person likes this

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

if there is a need for update the Controls often you can use a func for it:

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

$hGui = GUICreate("_SetProgress Test", 300, 125, 302, 218)
$idprgInfo = GUICtrlCreateProgress(8, 70, 285, 30)
$idlblInfo2 = GUICtrlCreateLabel("0", 8, 20, 285, 25, $ES_CENTER)
$hGUI_c = GUICreate("", 184, 30, 8, 73, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TRANSPARENT, $WS_EX_MDICHILD), $hGui)
GUISetBkColor(0x989898, $hGUI_c)
$idlblInfo = GUICtrlCreateLabel("0", 0, 0, 184, 25, $ES_CENTER)
GUICtrlSetFont(-1, 12, 1000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
_WinAPI_SetLayeredWindowAttributes($hGUI_c, 0x989898)
GUISetState(@SW_SHOW, $hGui)
GUISetState(@SW_SHOWNA, $hGUI_c)
$sUpdateIDs=$idprgInfo&'|'&$idlblInfo&'|'&$idlblInfo2
;string with all IDs needing update the progress, separated with "|"

For $i=1 to 90000
    _SetProgress($i/1000,$sUpdateIDs,0)
    ;Sleep(Random(10,30,1))
Next
Sleep(5000)
_SetProgress(100,$sUpdateIDs)

Sleep(2000)

Func _SetProgress($nPercent,$sIDs,$iDecPlaces=2)
    ;for updating several Controls
    ;params:    $nPercent
    ;           $sIDs       string with all IDs needing update the progress, separated with "|"
    ;           $iDecPlaces [optional] Integer indicating how many places to the right of the decimal are be shown. If omitted, Round there are 2 decimalplaces shown.
    ;author autobert
    Local Static $nOld
    Local $nNew=Round($nPercent,$iDecPlaces)
    if $nNew=$nOld Then Return  ;to avoid heavy flickr
    $nOld=$nNew
    $aIDs=StringSplit($sIDs,'|')
    For $x=1 To $aIDs[0]
        GUICtrlSetData($aIDs[$x], StringFormat('%10.8s %',$nNew))
    Next
EndFunc

 

Edited by AutoBert

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