Jump to content

Button Text Change


Recommended Posts

What is supposed to happen is when you check a box it is supposed to change the Close button text to Save.

The code only works when I put a message box in there to read the button odd yes. Working code is the bottom code block.

The only difference between the 2 code blocks is this one line " MsgBox(0,"",GUICtrlRead($actionButton))".

Maybe, i'm going about this in the wrong fashion. Any help would be appreciated.

non working code

#include <GUIConstantsEx.au3>
UserPerfs()
Func UserPerfs()
; gui for user preferences
CONST $DEFAULT_EMAIL_HOT_KEY = "^!e"
CONST $DEFAULT_EMAIL_HOT_KEY_DEFINITION = "! = ALT  + = SHIFT  ^ = CTRL  # = WINKEY"
dim $defaultTechLabel
dim $defaultTechChkbox
dim $nonDefaultTechLabel
dim $nonDefaultTechInput
dim $userPrefResult
dim $defaultTechChkboxState
dim $DefaultEmailHotKeyLabel
dim $defaultEmailHotKeyChkbox
dim $defaultEmailHotKeyChkboxState
dim $nonDefaultEmailHotKeyLabel
dim $nonDefaultEmailHotKeyInput
dim $actionButton
dim $cancelButton
Opt("GUICoordMode", 2)
GUICreate("Preferences")
$defaultTechChkbox = GUICtrlCreateCheckbox("Use Non-Default Technician Name",5,5,200,20)
$nonDefaultTechLabel = GUICtrlCreateLabel("Current Technician Name",-1,0,175,20)
$nonDefaultTechInput = GUICtrlCreateInput(getLoggedIn(),-1,0,175,20)
$defaultEmailHotKeyChkbox = GUICtrlCreateCheckbox("Use Non-Default Hot Key",-1,0,175,20)
$nonDefaultEmailHotKeyLabel = GUICtrlCreateLabel("Hot Key",-1,0,50,20)
GUICtrlCreateLabel("Use these values to combine keys: " & $DEFAULT_EMAIL_HOT_KEY_DEFINITION,-1,0,400,20)
GUICtrlCreateLabel("EX:  ^!e = CTRL+ALT+e",-1,0,150,20)
$nonDefaultEmailHotKeyInput = GUICtrlCreateInput($DEFAULT_EMAIL_HOT_KEY,-1,0,175,20)
$actionButton = GUICtrlCreateButton("Close",-1,0,50,20)
$cancelButton = GUICtrlCreateButton("Cancel",0,-1,50,20)
GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)

GUISetState()
    While 1
            $userPrefResult = GUIGetMsg()
            $defaultTechChkboxState = GUICtrlRead($defaultTechChkbox)
            $defaultEmailHotKeyChkboxState = GUICtrlRead($defaultEmailHotKeyChkbox)
            if $defaultTechChkboxState = $GUI_CHECKED then
            ;set tech input to enabled
                if GUICtrlGetState($nonDefaultTechInput) - 128 >= 0  Then
                    GUICtrlSetState($nonDefaultTechInput,$GUI_ENABLE)
                EndIf
                if GUICtrlRead($actionButton) = "close" Then
                    GUICtrlSetData($actionButton,"save")
                EndIf
            Else
            ;set tech input to disabled
                if Not(GUICtrlGetState($nonDefaultTechInput) - 128 >= 0) Then
                    GUICtrlSetData ($nonDefaultTechInput,getLoggedIn())
                    GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
                EndIf
            EndIf

            if $defaultEmailHotKeyChkboxState = $GUI_CHECKED then
            ;set tech input to enabled
                if GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0  Then
                    GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_ENABLE)
                EndIf
                if GUICtrlRead($actionButton) = "close" Then
                    GUICtrlSetData($actionButton,"save")
                EndIf
            Else
            ;set tech input to disabled
                if Not(GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0) Then
                    GUICtrlSetData ($nonDefaultEmailHotKeyInput,$DEFAULT_EMAIL_HOT_KEY)
                    GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)
                EndIf
            EndIf
            if $defaultEmailHotKeyChkbox <> $GUI_CHECKED and $defaultTechChkbox <> $GUI_CHECKED Then
                if GUICtrlRead($actionButton) = "save" Then
                    GUICtrlSetData($actionButton,"close")
                EndIf
            EndIf
            Select
                case $userPrefResult = -3
                    Return
                Case $userPrefResult = $actionButton

                case $userPrefResult = $cancelButton
                    Return
            EndSelect
    WEnd
EndFunc
Func getLoggedIn()
    Dim $wshNetwork
    Dim $userName
    Dim $userNameArray
    $wshNetwork = ObjCreate("WScript.Network")
    $userName = $wshNetwork.UserName
    $userName = StringReplace($userName, "_", " ")
    $userNameArray = StringSplit($userName, " ", 2)
    $userName = ""
    For $word In $userNameArray
        $userName &= firstCapRestLowWord($word) & " "
    Next
    Return StringStripWS($userName, 3)
EndFunc  ;==>getLoggedIn

Func firstCapRestLowWord($WordToChange)
;~converts a word to the format of the first letter caplitalized and rest lower case ex. TROY = Troy or TrOy = Troy or troy = Troy
    Dim $first
    Dim $rest
    If StringLen($WordToChange) > 1 Then
        $first = StringMid($WordToChange, 1, 1)
        $rest = StringMid($WordToChange, 2)
    Else
        $first = $WordToChange
        $rest = ""
    EndIf
    $first = StringUpper($first)
    $rest = StringLower($rest)
    Return StringStripWS($first & $rest, 3)
EndFunc  ;==>firstCapRestLowWord

working code

#include <GUIConstantsEx.au3>
UserPerfs()
Func UserPerfs()
; gui for user preferences
CONST $DEFAULT_EMAIL_HOT_KEY = "^!e"
CONST $DEFAULT_EMAIL_HOT_KEY_DEFINITION = "! = ALT  + = SHIFT  ^ = CTRL  # = WINKEY"
dim $defaultTechLabel
dim $defaultTechChkbox
dim $nonDefaultTechLabel
dim $nonDefaultTechInput
dim $userPrefResult
dim $defaultTechChkboxState
dim $DefaultEmailHotKeyLabel
dim $defaultEmailHotKeyChkbox
dim $defaultEmailHotKeyChkboxState
dim $nonDefaultEmailHotKeyLabel
dim $nonDefaultEmailHotKeyInput
dim $actionButton
dim $cancelButton
Opt("GUICoordMode", 2)
GUICreate("Preferences")
$defaultTechChkbox = GUICtrlCreateCheckbox("Use Non-Default Technician Name",5,5,200,20)
$nonDefaultTechLabel = GUICtrlCreateLabel("Current Technician Name",-1,0,175,20)
$nonDefaultTechInput = GUICtrlCreateInput(getLoggedIn(),-1,0,175,20)
$defaultEmailHotKeyChkbox = GUICtrlCreateCheckbox("Use Non-Default Hot Key",-1,0,175,20)
$nonDefaultEmailHotKeyLabel = GUICtrlCreateLabel("Hot Key",-1,0,50,20)
GUICtrlCreateLabel("Use these values to combine keys: " & $DEFAULT_EMAIL_HOT_KEY_DEFINITION,-1,0,400,20)
GUICtrlCreateLabel("EX:  ^!e = CTRL+ALT+e",-1,0,150,20)
$nonDefaultEmailHotKeyInput = GUICtrlCreateInput($DEFAULT_EMAIL_HOT_KEY,-1,0,175,20)
$actionButton = GUICtrlCreateButton("Close",-1,0,50,20)
$cancelButton = GUICtrlCreateButton("Cancel",0,-1,50,20)
GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)

GUISetState()
    While 1
            $userPrefResult = GUIGetMsg()
            $defaultTechChkboxState = GUICtrlRead($defaultTechChkbox)
            $defaultEmailHotKeyChkboxState = GUICtrlRead($defaultEmailHotKeyChkbox)
            if $defaultTechChkboxState = $GUI_CHECKED then
            ;set tech input to enabled
                if GUICtrlGetState($nonDefaultTechInput) - 128 >= 0  Then
                    GUICtrlSetState($nonDefaultTechInput,$GUI_ENABLE)
                EndIf
                if GUICtrlRead($actionButton) = "close" Then
                    GUICtrlSetData($actionButton,"save")
                EndIf
            Else
            ;set tech input to disabled
                if Not(GUICtrlGetState($nonDefaultTechInput) - 128 >= 0) Then
                    GUICtrlSetData ($nonDefaultTechInput,getLoggedIn())
                    GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
                EndIf
            EndIf

            if $defaultEmailHotKeyChkboxState = $GUI_CHECKED then
            ;set tech input to enabled
                if GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0  Then
                    GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_ENABLE)
                EndIf
                if GUICtrlRead($actionButton) = "close" Then
                    GUICtrlSetData($actionButton,"save")
                EndIf
            Else
            ;set tech input to disabled
                if Not(GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0) Then
                    GUICtrlSetData ($nonDefaultEmailHotKeyInput,$DEFAULT_EMAIL_HOT_KEY)
                    GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)
                EndIf
            EndIf
            MsgBox(0,"",GUICtrlRead($actionButton))
            if $defaultEmailHotKeyChkbox <> $GUI_CHECKED and $defaultTechChkbox <> $GUI_CHECKED Then
                if GUICtrlRead($actionButton) = "save" Then
                    GUICtrlSetData($actionButton,"close")
                EndIf
            EndIf
            Select
                case $userPrefResult = -3
                    Return
                Case $userPrefResult = $actionButton

                case $userPrefResult = $cancelButton
                    Return
            EndSelect
    WEnd
EndFunc
Func getLoggedIn()
    Dim $wshNetwork
    Dim $userName
    Dim $userNameArray
    $wshNetwork = ObjCreate("WScript.Network")
    $userName = $wshNetwork.UserName
    $userName = StringReplace($userName, "_", " ")
    $userNameArray = StringSplit($userName, " ", 2)
    $userName = ""
    For $word In $userNameArray
        $userName &= firstCapRestLowWord($word) & " "
    Next
    Return StringStripWS($userName, 3)
EndFunc  ;==>getLoggedIn

Func firstCapRestLowWord($WordToChange)
;~converts a word to the format of the first letter caplitalized and rest lower case ex. TROY = Troy or TrOy = Troy or troy = Troy
    Dim $first
    Dim $rest
    If StringLen($WordToChange) > 1 Then
        $first = StringMid($WordToChange, 1, 1)
        $rest = StringMid($WordToChange, 2)
    Else
        $first = $WordToChange
        $rest = ""
    EndIf
    $first = StringUpper($first)
    $rest = StringLower($rest)
    Return StringStripWS($first & $rest, 3)
EndFunc  ;==>firstCapRestLowWord
Link to comment
Share on other sites

  • Moderators

ibigpapa,

Your mistake (and an easy one to make) is to think that the return from GUICtrlRead will be a simple $GUI_CHECKED! In fact it could (and almost certainly will) be a combination of states (see Help file). So you need to check for the specific state you are looking for with BitAND. This code works for me:

CODE
#include <GUIConstantsEx.au3>
UserPerfs()
Func UserPerfs()
; gui for user preferences
CONST $DEFAULT_EMAIL_HOT_KEY = "^!e"
CONST $DEFAULT_EMAIL_HOT_KEY_DEFINITION = "! = ALT  + = SHIFT  ^ = CTRL  # = WINKEY"
dim $defaultTechLabel
dim $defaultTechChkbox
dim $nonDefaultTechLabel
dim $nonDefaultTechInput
dim $userPrefResult
dim $defaultTechChkboxState
dim $DefaultEmailHotKeyLabel
dim $defaultEmailHotKeyChkbox
dim $defaultEmailHotKeyChkboxState
dim $nonDefaultEmailHotKeyLabel
dim $nonDefaultEmailHotKeyInput
dim $actionButton
dim $cancelButton
Opt("GUICoordMode", 2)
GUICreate("Preferences")
$defaultTechChkbox = GUICtrlCreateCheckbox("Use Non-Default Technician Name",5,5,200,20)
$nonDefaultTechLabel = GUICtrlCreateLabel("Current Technician Name",-1,0,175,20)
$nonDefaultTechInput = GUICtrlCreateInput(getLoggedIn(),-1,0,175,20)
$defaultEmailHotKeyChkbox = GUICtrlCreateCheckbox("Use Non-Default Hot Key",-1,0,175,20)
$nonDefaultEmailHotKeyLabel = GUICtrlCreateLabel("Hot Key",-1,0,50,20)
GUICtrlCreateLabel("Use these values to combine keys: " & $DEFAULT_EMAIL_HOT_KEY_DEFINITION,-1,0,400,20)
GUICtrlCreateLabel("EX:  ^!e = CTRL+ALT+e",-1,0,150,20)
$nonDefaultEmailHotKeyInput = GUICtrlCreateInput($DEFAULT_EMAIL_HOT_KEY,-1,0,175,20)
$actionButton = GUICtrlCreateButton("Close",-1,0,50,20)
$cancelButton = GUICtrlCreateButton("Cancel",0,-1,50,20)
GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)

GUISetState()
    While 1
            $userPrefResult = GUIGetMsg()
            $defaultTechChkboxState = BitAnd(GUICtrlRead($defaultTechChkbox), $GUI_CHECKED)   ; <<<<<<<<<<<<<<<<<<<<<<<<<<<
            $defaultEmailHotKeyChkboxState = BitAND(GUICtrlRead($defaultEmailHotKeyChkbox), $GUI_CHECKED) ; <<<<<<<<<<<<<<<<<<<<<<<<

            if $defaultTechChkboxState then
        ;set tech input to enabled
                if GUICtrlGetState($nonDefaultTechInput) - 128 >= 0  Then
                    GUICtrlSetState($nonDefaultTechInput,$GUI_ENABLE)
                EndIf
                if GUICtrlRead($actionButton) = "close" Then
                    GUICtrlSetData($actionButton,"save")
                EndIf
            Else
           ;set tech input to disabled
                if Not(GUICtrlGetState($nonDefaultTechInput) - 128 >= 0) Then
                    GUICtrlSetData ($nonDefaultTechInput,getLoggedIn())
                    GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
                EndIf
            EndIf

            if $defaultEmailHotKeyChkboxState then
           ;set tech input to enabled
                if GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0  Then
                    GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_ENABLE)
                EndIf
                if GUICtrlRead($actionButton) = "close" Then
                    GUICtrlSetData($actionButton,"save")
                EndIf
            Else
           ;set tech input to disabled
                if Not(GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0) Then
                    GUICtrlSetData ($nonDefaultEmailHotKeyInput,$DEFAULT_EMAIL_HOT_KEY)
                    GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)
                EndIf
            EndIf

            if (Not $defaultTechChkboxState) and (Not $defaultEmailHotKeyChkboxState) Then ; <<<<<<<<<<<<<<<<<<<<<<<<
                if GUICtrlRead($actionButton) <> "close" Then
                    GUICtrlSetData($actionButton,"close")
                EndIf
            EndIf

            Select
                case $userPrefResult = -3
                    Return
                Case $userPrefResult = $actionButton

                case $userPrefResult = $cancelButton
                    Return
            EndSelect
    WEnd
EndFunc
Func getLoggedIn()
    Dim $wshNetwork
    Dim $userName
    Dim $userNameArray
    $wshNetwork = ObjCreate("WScript.Network")
    $userName = $wshNetwork.UserName
    $userName = StringReplace($userName, "_", " ")
    $userNameArray = StringSplit($userName, " ", 2)
    $userName = ""
    For $word In $userNameArray
        $userName &= firstCapRestLowWord($word) & " "
    Next
    Return StringStripWS($userName, 3)
EndFunc ;==>getLoggedIn

Func firstCapRestLowWord($WordToChange)
;~converts a word to the format of the first letter caplitalized and rest lower case ex. TROY = Troy or TrOy = Troy or troy = Troy
    Dim $first
    Dim $rest
    If StringLen($WordToChange) > 1 Then
        $first = StringMid($WordToChange, 1, 1)
        $rest = StringMid($WordToChange, 2)
    Else
        $first = $WordToChange
        $rest = ""
    EndIf
    $first = StringUpper($first)
    $rest = StringLower($rest)
    Return StringStripWS($first & $rest, 3)
EndFunc ;==>firstCapRestLowWord
I have marked the changed lines with "; <<<<<<<<<<<<<<<<<<<<<<<<"

Ask if anything is unclear.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

I didn't look at the working one, but maybe this change does what you intended.

#include <GUIConstantsEx.au3>
 UserPerfs()
 Func UserPerfs()
; gui for user preferences
 CONST $DEFAULT_EMAIL_HOT_KEY = "^!e"
 CONST $DEFAULT_EMAIL_HOT_KEY_DEFINITION = "! = ALT  + = SHIFT  ^ = CTRL  # = WINKEY"
 dim $defaultTechLabel
 dim $defaultTechChkbox
 dim $nonDefaultTechLabel
 dim $nonDefaultTechInput
 dim $userPrefResult
 dim $defaultTechChkboxState
 dim $DefaultEmailHotKeyLabel
 dim $defaultEmailHotKeyChkbox
 dim $defaultEmailHotKeyChkboxState
 dim $nonDefaultEmailHotKeyLabel
 dim $nonDefaultEmailHotKeyInput
 dim $actionButton
 dim $cancelButton
 Opt("GUICoordMode", 2)
 GUICreate("Preferences")
 $defaultTechChkbox = GUICtrlCreateCheckbox("Use Non-Default Technician Name",5,5,200,20)
 $nonDefaultTechLabel = GUICtrlCreateLabel("Current Technician Name",-1,0,175,20)
 $nonDefaultTechInput = GUICtrlCreateInput(getLoggedIn(),-1,0,175,20)
 $defaultEmailHotKeyChkbox = GUICtrlCreateCheckbox("Use Non-Default Hot Key",-1,0,175,20)
 $nonDefaultEmailHotKeyLabel = GUICtrlCreateLabel("Hot Key",-1,0,50,20)
 GUICtrlCreateLabel("Use these values to combine keys: " & $DEFAULT_EMAIL_HOT_KEY_DEFINITION,-1,0,400,20)
 GUICtrlCreateLabel("EX:  ^!e = CTRL+ALT+e",-1,0,150,20)
 $nonDefaultEmailHotKeyInput = GUICtrlCreateInput($DEFAULT_EMAIL_HOT_KEY,-1,0,175,20)
 $actionButton = GUICtrlCreateButton("Close",-1,0,50,20)
 $cancelButton = GUICtrlCreateButton("Cancel",0,-1,50,20)
 GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
 GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)
 $StepBDone = 0
 GUISetState()
     While 1
             $userPrefResult = GUIGetMsg()
             $defaultTechChkboxState = GUICtrlRead($defaultTechChkbox)
             $defaultEmailHotKeyChkboxState = GUICtrlRead($defaultEmailHotKeyChkbox)
             if $defaultTechChkboxState = $GUI_CHECKED then
           ;set tech input to enabled
                 if BitAnd(GUICtrlGetState($nonDefaultTechInput),$GUI_DISABLE) Then; - 128 >= 0  Then;$GUI_DISABLE
                     GUICtrlSetState($nonDefaultTechInput,$GUI_ENABLE)
                 EndIf
                 if GUICtrlRead($actionButton) = "close" Then
                     GUICtrlSetData($actionButton,"save")
                 EndIf
             Else
           ;set tech input to disabled
                 if Not BitAnd(GUICtrlGetState($nonDefaultTechInput),128) and Not $StepBDone Then
                     GUICtrlSetData ($nonDefaultTechInput,getLoggedIn())
                     GUICtrlSetState($nonDefaultTechInput,$GUI_DISABLE)
                     $StepBDone = 1
                 EndIf
             EndIf
 
             if $defaultEmailHotKeyChkboxState = $GUI_CHECKED Or $defaultTechChkboxState = $GUI_CHECKED then
           ;set tech input to enabled
                 if BitAnd(GUICtrlGetState($nonDefaultEmailHotKeyInput),128)  Then
                     GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_ENABLE)
                 EndIf
                 if GUICtrlRead($actionButton) = "close" Then
                     GUICtrlSetData($actionButton,"save")
                 EndIf
             Else
           ;set tech input to disabled
                 if Not(GUICtrlGetState($nonDefaultEmailHotKeyInput) - 128 >= 0) Then
                     GUICtrlSetData ($nonDefaultEmailHotKeyInput,$DEFAULT_EMAIL_HOT_KEY)
                     GUICtrlSetState($nonDefaultEmailHotKeyInput,$GUI_DISABLE)
                 EndIf
             
             if $defaultTechChkbox <> $GUI_CHECKED Then
                 if GUICtrlRead($actionButton) = "save" Then
                     GUICtrlSetData($actionButton,"close")
                 EndIf
             EndIf
             
             EndIf
             Select
                 case $userPrefResult = -3
                     Return
                 Case $userPrefResult = $actionButton
 
                 case $userPrefResult = $cancelButton
                     Return
             EndSelect
     WEnd
 EndFunc
 Func getLoggedIn()
     Dim $wshNetwork
     Dim $userName
     Dim $userNameArray
     $wshNetwork = ObjCreate("WScript.Network")
     $userName = $wshNetwork.UserName
     $userName = StringReplace($userName, "_", " ")
     $userNameArray = StringSplit($userName, " ", 2)
     $userName = ""
     For $word In $userNameArray
         $userName &= firstCapRestLowWord($word) & " "
     Next
     Return StringStripWS($userName, 3)
 EndFunc;==>getLoggedIn
 
 Func firstCapRestLowWord($WordToChange)
;~converts a word to the format of the first letter caplitalized and rest lower case ex. TROY = Troy or TrOy = Troy or troy = Troy
     Dim $first
     Dim $rest
     If StringLen($WordToChange) > 1 Then
         $first = StringMid($WordToChange, 1, 1)
         $rest = StringMid($WordToChange, 2)
     Else
         $first = $WordToChange
         $rest = ""
     EndIf
     $first = StringUpper($first)
     $rest = StringLower($rest)
     Return StringStripWS($first & $rest, 3)
 EndFunc;==>firstCapRestLowWord

EDIT:Whoops, I didn't see Melba23's post. That means I took about 8 minutes changing about 2 lines. oh dear.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Moderators

martin,

I sympathise - it is very annoying when that happens! But imagine if you could charge by the minute and not by the job......

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...