Jump to content

Ignore Control in TabOrder


Go to solution Solved by Melba23,

Recommended Posts

Posted

Using the Tab key in a GUI activates the next Control in the order defined when creating the GUI.
Now I want to ignore a Control (the question mark icon). This icon displays some help text using a ToolTip. When ignored the ToolTip should still be displayed.

When the user wants to jump to the next input Control he has to press Tab twice because the icon Control gets activated (which is not visible to the user) before the input Control gets activated.
Does anyone have a solution for this problem?

163766554_ShutterAuswahl_005.png.5de35a8062836cf12964142bee0915c7.png

My UDFs and Tutorials:

  Reveal hidden contents

 

  • Moderators
  • Solution
Posted (edited)

water,

Have you tried removing the $WS_TABSTOP style from the relevant control? It is a default setting when the icon control is created.

M23

Edited by Melba23
Speeling!

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:

  Reveal hidden contents

 

Posted (edited)

If it can help, I use it in scripts as Melba23 just indicated, with this code :

Case $idRadio_1
    $iHow_Choose_img = 1 ; a whole folder (no recursion) using FileSelectFolder()
    Remove_Style($WS_TABSTOP, $idRadio_1) ; cf note dans F10() , pareil pour tous les autres boutons radios ci-dessous.

Case $idRadio_2
    $iHow_Choose_img = 2 ; a whole folder + subfolders, using  FileSelectFolder()
    Remove_Style($WS_TABSTOP, $idRadio_2)

Case $idRadio_3
    $iHow_Choose_img = 3 ; pick files individually, using FileOpenDialog()
    Remove_Style($WS_TABSTOP, $idRadio_3)

;====================================================
Func Remove_Style($iStyleToRemove, $id1, $id2 = 0, $id3 = 0, $id4 = 0, $id5 = 0, _
    $id6 = 0, $id7 = 0, $id8 = 0, $id9 = 0, $id10 = 0)

    Local $hControl, $iStyle
    For $i = 1 To @NumParams - 1 ; @NumParams doit être compris entre 2 et 11. Le 1er paramètre sera toujours le style à ôter.
        $hControl = GUICtrlGetHandle(Eval("id" & $i))
        $iStyle = _WinAPI_GetWindowLong($hControl, $GWL_STYLE)
        If BitAND($iStyle, $iStyleToRemove) = $iStyleToRemove Then
            _WinAPI_SetWindowLong($hControl, $GWL_STYLE, BitXOR($iStyle, $iStyleToRemove))
        Endif
    Next

EndFunc ; Remove_Style()

The function can also be called like this (real syntax found in the script) :

Remove_Style($WS_TABSTOP, $idRadio_1, $idRadio_2, $idRadio_3, $idRadio_4, $idRadio_11, _
    $idRadio_12, $idRadio_13, $idToolTip, $idButton_OK, $idButton_Cancel)

 

Edited by pixelsearch

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted (edited)

You guys are absolutely amazing :thumbsup:
Thank you both for this solution, it works like a charm!

Unfortunately I can only mark a single post as solution :( So I marked Melba's post as the solution and pixelsearch's post got a like :)

Edited by water

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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