Kudzu309 Posted February 1, 2006 Posted February 1, 2006 (edited) Hi, I've created a window that I would like to be solid red with a message and a button to click to view a log file. GUICreate ("program",300,200,-1,-1,$WS_SYSMENU) GUICtrlCreateLabel (@LF & "Program FAILED.",1,1,300,200,$SS_CENTER) GUICtrlSetFont (-1,20) GUICtrlSetColor (-1,0xffffff) GUICtrlSetBkColor (-1,0xff0000) $ViewLog = GUICtrlCreateButton ("View Log",130,125,-1,-1,-1) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $ViewLog then RunWait(@ComSpec & " /c notepad c:\logfile.log", "", @SW_HIDE) ExitLoop EndIf Wend The problem is that the label seems to "cover up" the button so that I can't click on it, even though it's completely visible. I found this out by decreasing the size of the label until it was above the button and then I could click on it. I also tried putting GUICtrlCreateButton before GUICtrlCreateLabel, which even made is stranger; the button wasn't visible until the mouse was over it, and then it became visable and clickable. Very weird. Is there a different way to make the window red? Is there a way to force the button to be "on top" of the label so it's clickable? Thanks. Edited February 1, 2006 by Kudzu309
Valuater Posted February 1, 2006 Posted February 1, 2006 maybe this #include <GuiConstants.au3> GUICreate ("program",300,200,-1,-1,$WS_SYSMENU) GUISetBkColor (0xff0000) GUICtrlCreateLabel ("Program FAILED.",15,25,250,30,$SS_CENTER) GUICtrlSetFont (-1,20) GUICtrlSetColor (-1,0xffffff) ;GUICtrlSetBkColor (-1,0xff0000) $ViewLog = GUICtrlCreateButton ("View Log",130,125,-1,-1,-1) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $ViewLog then RunWait(@ComSpec & " /c notepad c:\logfile.log", "", @SW_HIDE) ExitLoop EndIf Wend 8)
Kudzu309 Posted February 1, 2006 Author Posted February 1, 2006 Thanks Valuater, but I had copied the code of that out of a larger script that I had written, that does have #include <GuiConstants.au3> in the beginning, so unfortunately that's not the problem, but thanks for your reply. maybe this #include <GuiConstants.au3> ... 8)
Valuater Posted February 1, 2006 Posted February 1, 2006 Thanks Valuater, but I had copied the code of that out of a larger script that I had written, that does have #include <GuiConstants.au3> in the beginning, so unfortunately that's not the problem, but thanks for your reply.that include was for me and had very little to do with the changes i made... socopy the script i wrote and check it out8)
Kudzu309 Posted February 2, 2006 Author Posted February 2, 2006 that include was for me and had very little to do with the changes i made... socopy the script i wrote and check it out8)Oops, I guess that I didn't look at it closely enough (sorry, was in a hurry at the time). Somehow I never saw AutoIt's GUISetBkColor function and was using GUICtrlSetBkColor instead to color the labels. Thanks again for your help!
foggw Posted February 3, 2006 Posted February 3, 2006 I beat my head against the wall the other day with the same problem. Quick check where the label is by adding $SS_SUNKEN to it's style. Bill
Kudzu309 Posted February 4, 2006 Author Posted February 4, 2006 I beat my head against the wall the other day with the same problem.Quick check where the label is by adding $SS_SUNKEN to it's style.BillAhh, thanks for the tip. I was using the AutoIt Window Info to outline the peices of the window.Steve
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