Sign in to follow this  
Followers 0
gottygolly

Expecting a "="?

3 posts in this topic

I saw a code earlier today and I copied a line in it but for some reason it won't work in my code.

I don't know what i'm missing or adding but could someone please explain this to me?

My Code:

$gui = GUICreate("",640,480,-1,-1)
Opt("GUIOnEventMode",1)
GUISetOnEvent(-3,"_Exit")
GUISetState()
Dim $to[11]
$g = 5
For $x = 1 To UBound($to) - 1
   $b[$x] = GUICtrlCreateButton("Button",5,$g,100,30)
   $g+=35
   Next
While 1
   Sleep(10)
WEnd

Func _Exit()
   Exit
   EndFunc

Other Code: 

#include<Array.au3>
#include<DateTimeConstants.au3>
#include<GUIConstantsEx.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include<GUIConstants.au3>
#include<Array.au3>
#include<Misc.au3>
#include <Sound.au3>
#include <GuiComboBox.au3>
#include <Date.au3>
#include <String.au3>
#include<guicomboboxex.au3>
#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=..\Test.exe
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****


Opt("GUIOnEventMode", 1)

Global $label,$Progress


$Form1 = GUICreate("Countdown", 361, 445, 384, 252)
$Combo1 = GUICtrlCreateCombo("", 240, 8, 113, 25, BitOR($CBS_DROPDOWNLIST, $CBS_SORT))
GUICtrlSetOnEvent(-1, "combo_change")
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Date = GUICtrlCreateDate("", 5, 5, 70, 20, $DTS_TIMEFORMAT)




Dim $label[11]
Dim $Progress[11]

$g = 0
For $x = 1 To UBound($label) - 1
  
    $Progress[$x] = GUICtrlCreateProgress(8, 40 + $g, 169, 17)
    GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlSetBkColor(-1, 0x00ff00)
   
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
    GUICtrlSetStyle(-1, 1)
    GUICtrlSetResizing(-1, $GUI_DOCKALL)
    GUICtrlSetState(-1,$GUI_DISABLE)
    
    $label[$x] = GUICtrlCreateLabel("this is a test label", 8, 40 + $g, 120, 17,$SS_NOTIFY)
    GUICtrlSetOnEvent(-1, "label_test")
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1,0)
    GUICtrlSetResizing(-1, $GUI_DOCKALL)
    GUICtrlSetBkColor($label[$x], $GUI_BKCOLOR_TRANSPARENT)
    
    $g += 20

GUISetOnEvent($GUI_EVENT_CLOSE,"closeall")
Next

GUISetState(@SW_SHOW)
_GUICtrlComboBoxEx_SetCurSel(GUICtrlGetHandle($Combo1), 0)

While 1
    Sleep(50)
WEnd

Func closeall()
    
    Exit
EndFunc


Func label_test()
    ConsoleWrite("Label" & @LF)
    Local $iD = @GUI_CtrlId
   
    $sea = _ArraySearch($label, $iD)
    If Not @error Then MsgBox(0, "label", $iD & " " & $sea, 0)
   
EndFunc ;==>label

Func combo_change()
EndFunc ;==>combo_change

Thank you in advance for any support you provide!

Share this post


Link to post
Share on other sites



What do you mean by "won't work"?

Could you please be a bit more specific?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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