Jump to content

Recommended Posts

Posted

On a daily basis, I use a proprietary HIS (Hospital Information System) knonw as Meditech.  On some of their screens, they have buttons like this;

post-4264-0-54734000-1395348619_thumb.jp

When you hit the F8 key, the buttons will change and the hotkey gets identified as shown below;

post-4264-0-88235500-1395348640_thumb.jp

I would like to mimic this action with some GUI's that I have developed using AutoIT, but I can't figure out how to get the underline character to show up on the letter I want to be the hotkey.  Actually, if I could just figure out how to make the first character of the button label be underlined, that would suffice for now.

Can anyone point me in the right direction?

  • Solution
Posted (edited)

??

GUISetAccelerators ( accelerators [, winhandle] )

EDIT:

from helpfile GUICtrlCreateButton()

#include <GUIConstantsEx.au3>

Example()

Func Example()
    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 300, 200)

    ; Create a button control.
    Local $idNotepad = GUICtrlCreateButton("Run Notepad", 120, 170, 85, 25)
    Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    Local $iPID = 0

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idClose
                ExitLoop

            Case $idNotepad
                ; Run Notepad with the window maximized.
                $iPID = Run("notepad.exe", "", @SW_SHOWMAXIMIZED)

        EndSwitch
    WEnd

    ; Delete the previous GUI and all controls.
    GUIDelete($hGUI)

    ; Close the Notepad process using the PID returned by Run.
    If $iPID Then ProcessClose($iPID)
EndFunc   ;==>Example

but change this:

Local $idNotepad = GUICtrlCreateButton("&Run Notepad", 120, 170, 85, 25)
    Local $idClose = GUICtrlCreateButton("&Close", 210, 170, 85, 25)

I mean use & char.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...