computergroove

GUI Always on top question

4 posts in this topic

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form 1", 377, 280, 192, 114)
GUICtrlSetState($Form1,$GUI_ONTOP)
$Input1 = GUICtrlCreateInput("0", 24, 40, 49, 21)
$Input2 = GUICtrlCreateInput("0", 24, 72, 49, 21)
$Input3 = GUICtrlCreateInput("0", 24, 104, 49, 21)
$Input4 = GUICtrlCreateInput("0", 24, 136, 49, 21)
$Input5 = GUICtrlCreateInput("0", 24, 168, 49, 21)
$Input6 = GUICtrlCreateInput("0", 240, 40, 49, 21)
$Input7 = GUICtrlCreateInput("0", 240, 72, 49, 21)
$Input8 = GUICtrlCreateInput("0", 240, 104, 49, 21)
$Input9 = GUICtrlCreateInput("0", 240, 136, 49, 21)
$Input10 = GUICtrlCreateInput("0", 240, 168, 49, 21)

$Label1 = GUICtrlCreateLabel("Option 1", 88, 40, 61, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Option 2", 88, 72, 43, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("Option 3", 88, 104, 74, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("Option 4", 88, 136, 42, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("Option 5", 88, 168, 56, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label6 = GUICtrlCreateLabel("Option 6", 304, 40, 54, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label7 = GUICtrlCreateLabel("Option 7", 304, 72, 57, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label8 = GUICtrlCreateLabel("Option 8", 304, 104, 53, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label9 = GUICtrlCreateLabel("Option 9", 304, 136, 41, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label10 = GUICtrlCreateLabel("Option 10", 304, 168, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label11 = GUICtrlCreateLabel("Pause Script", 144, 8, 98, 17)
$Pause = GUICtrlCreateButton("Pause", 24, 216, 97, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Im trying to get this window to stay on top. GUICTRLSETSTATE doesn't seem to work or Im doing it wrong. Also at one point Melba23 replied to one of my posts and made code like the example above significantly shorter somehow. I made the above with Koda. How can I shorten it?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



computergroove,

Why would you expect GUICtrlSetState to work on a GUI? The WinSetOnTop function might be more useful. ;)

 

How can I shorten it?

Use loops with a suitable algorithm to determine the coordinates. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

For future reference
 

$Form1 = GUICreate("Form 1", 377, 280, 192, 114)
WinSetOnTop($Form1,"",1)

Worked

and

$Form1 = GUICreate("Form 1", 377, 280, 192, 114,0,$WS_EX_TOPMOST)

also worked

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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