NELyon Posted August 8, 2006 Share Posted August 8, 2006 (edited) Ok, i'm trying to roll out html <img> codes. I am trying to put two in a row, and then a <br>. Instead it generates the two codes, then flickers my edit box and steps the number up one every millisecond. CAn anyone help me with this code? #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 622, 441, 192, 125) $Edit1 = GUICtrlCreateEdit("", 0, 0, 617, 385, -1, $WS_EX_CLIENTEDGE) GUICtrlSetData($Edit1, "AEdit1") $Button1 = GUICtrlCreateButton("Generate", 200, 400, 185, 33) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 for $i = 1 to 80 step +1 GUICtrlSetData($Edit1, "<img src="&$i&"><Img src="&$i&"><br>") Next EndSelect WEnd Exit EDIT: There are 80 images just name 1.jpg, 2.jpg ect.. Edited August 8, 2006 by codemyster Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 8, 2006 Moderators Share Posted August 8, 2006 Try this: #include <GUIConstants.au3> Opt("GuiOnEventMode", True) $Form1 = GUICreate("AForm1", 622, 441, 192, 125) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $Edit1 = GUICtrlCreateEdit("", 0, 0, 617, 385, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Generate", 200, 400, 185, 33) GUICtrlSetOnEvent(-1, "_GenerateHTML") GUISetState() While 1 Sleep(100) WEnd Func _GenerateHTML() Local $sHTML = "" For $i = 1 To 80 If Mod($i, 2) Then $sHTML &= "<Img src=" & $i & ".jpg>" Else $sHTML &= "<Img src=" & $i & ".jpg><br>" & @CRLF EndIf Next GUICtrlSetData($Edit1, $sHTML, "") EndFunc ;==>_GenerateHTML Func _Exit() Exit EndFunc ;==>_Exit Link to comment Share on other sites More sharing options...
NELyon Posted August 8, 2006 Author Share Posted August 8, 2006 Thanks. With some modding, this will work fine Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now