Jump to content

Recommended Posts

Posted (edited)

Ok i have a input box like this.

$name_input = GUICtrlCreateInput("Customer Name",250,500,300,25)

But when the GUI is active you have to click and highlight the text [Customer Name] to type the proper name in

Is there a simple way to have the text delete or vanish when you click the the input box to type the real name in?

Many thanks

Chimaera

Edited by Chimaera
Posted

Hi Chimaera,

I can only guess that you'll have to go the way over GUIRegisterMsg, to see when the Conrol has been clicked. Then you can delete the contents easily.

:)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
  • Moderators
Posted

Chimaera,

You can do it this way: :)

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hInput = GUICtrlCreateInput("Customer Name", 10, 10, 300, 25)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            $aCInfo = GUIGetCursorInfo()
            If $aCInfo[4] = $hInput Then GUICtrlSetData($hInput, "")
    EndSwitch

WEnd

Warning: This will clear the input every time you click in it. You might want to use a flag to make it happen only at the first click. :)

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:

  Reveal hidden contents

 

Posted

Nice Example Melba23, also this might be of some use as well >>

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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...