Jump to content
Sign in to follow this  
sias

A couple questions for the inquiring mind

Recommended Posts

sias

As the title states, I just have a couple simple questions, but I was unable to find the correct function in the help file or here on the forums. What I am looking for is a way to place a checkbox in the menu (for an "Always on top" feature). An example would be the autoit updater, as well as the Task Mananger. I have created the menu (below) I'm just not sure how to create the checkbox within the menu.

$menu = GuiCtrlCreateMenu ("Menu")
$aboutitem = GuiCtrlCreateMenuitem ("About",$menu)
$closeitem = GuiCtrlCreateMenuitem ("Close",$menu)
$menudate= GUICtrlCreateMenu( @MON & "/" & @MDAY & "/" &@YEAR )oÝ÷ Ù8^¢Ø^®«²Ø¨Z½è¬²¶§¦º{.­èjëh×ÚºÒ- Ò0¢é]-ç(k§Ü,ÈZ½é®Ø©è§¦ë[£¬jwp¢é])¶z'íêÞÆ°k+ajÛaz趦r¥u«­¢Ö¶èºm触ëljËa{&«yø¥çhºÐ'{¦¦W°¢é]mébì!zw§µêâ¬z¸G²¶º»(­«­¢f­Æ¥((zËh¶§{[£µêíç.®·§µº1ÇâWéhÂ+²x©zÚ'.®·§¶)éºÖèÅëºÚ"µÍÕRPÝÜX]QÜÝ
    ][ÝÑ]H[[YI][ÝË
K
KLKMJBÕRPÝÜX]SX[
    ][ÝÓSKÑÖVVVI][ÝËMK
BÕRPÝÜX]SX[
    ][ÝÒSI][ÝËMKÍJBÌÍØOHÕRPÝÜX]R[]
    ][ÝÉ][ÝËL
L
NÈ[ÛÕRPÝÜX]SX[
    ][ÝËÉ][ÝËÌK
LBÌÍØHÕRPÝÜX]R[]
    ][ÝÉ][ÝË

L
NÈ^BÕRPÝÜX]SX[
    ][ÝËÉ][ÝË
K
LBÌÍØOHÕRPÝÜX]R[]
    ][ÝÉ][ÝË
Ì
LÌ
NÈYXÌÍØÝHÕRPÝÜX]R[]
    ][ÝÉ][ÝËL
ÍK
NÈÝÕRPÝÜX]SX[
    ][ÝÎ][ÝËÌË
Î
BÌÍØZ[HÕRPÝÜX]R[]
    ][ÝÉ][ÝË

ÍK
NÈZ[]

Thanks to anyone that is able to assist me with these codes.


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites
FaT3oYCG

for the first question i dont have a clue but for the second you could do something like

$length = StringLen(GUICtrlRead($bm))
If $length = 10 Then
    GUICtrlSetState($bd, $GUI_FOCUS)
EndIf

etc. for all of your inputs


Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

Share this post


Link to post
Share on other sites
Nahuel

#include <GuiConstantsex.au3>
GUICreate("Test")
$Menu = GUICtrlCreateMenu("Test")

$CheckMenu = GUICtrlCreateMenuItem("Checkbox",$Menu)
GUICtrlSetState(-1, $GUI_CHECKED)

GUISetState()
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $CheckMenu
            If BitAND(GUICtrlRead($CheckMenu), $GUI_CHECKED) = $GUI_CHECKED Then
            ;if checked, uncheck
                GUICtrlSetState($CheckMenu, $GUI_UNCHECKED)
            Else
            ;if unchecked, check
                GUICtrlSetState($CheckMenu, $GUI_CHECKED)
            EndIf
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
sias

Thank you FaT3oYCG, and Hahuel very much for your help!


"The true measure of a man is how he treats someone who can do him absolutely no good."

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  

×