Jump to content

Read from other inputbox


lrstndm
 Share

Recommended Posts

Hi all,

I have an question.

is it possible to write something in inputbox1 and that it will immediately be shown on an other inputbox (inputbox2) when you type it?

i already tried to put an variable in the other inputbox but it doesn't work:(

is this possible?

Thanks in advance

Here is an small script of my tool where it needs to come:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$main = GUICreate("test",200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 10, 10, 150, 21)

$Input2 = GUICtrlCreateInput("", 10, 35, 150, 21)
$Button = GUICtrlCreateButton("ok", 110, 60, 50, 25)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
WEnd
Link to comment
Share on other sites

Try this:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$main = GUICreate("test",200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 10, 10, 150, 21)

$Input2 = GUICtrlCreateInput("", 10, 35, 150, 21)
$Button = GUICtrlCreateButton("ok", 110, 60, 50, 25)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
    GUICtrlSetData($Input2, GUICtrlRead($Input1))
WEnd

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Yes, I know it :graduated:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$main = GUICreate("test",200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 10, 10, 150, 21)

$Input2 = GUICtrlCreateInput("", 10, 35, 150, 21)
$Button = GUICtrlCreateButton("ok", 110, 60, 50, 25)
GUISetState(@SW_SHOW)

GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND')

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
WEnd

Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $chk

    $chk = BitAND($wParam, 0x0000FFFF)
    Switch $chk
        Case $Input1
            GUICtrlSetData($Input2, GUICtrlRead($Input1))
    EndSwitch
EndFunc

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

My tool works like this:

In inputbox1 i type an URL example: www.autoit.nl/Graphical

In inputbox2 the text is Autoit for example

Everthing what comes after the / from inputbox1 comes in inputbox2 but the text what is already in inputbox2 needs to stay there

in this example it needs to be:

Inputbox1: www.autoit.nl/Graphical

Inputbox2: GraphicalAutoit

The word Graphical will come in the inputbox2 before the word Autoit

Do you Know how this will work??

Thanks you very much in advance

This is the tool:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$main = GUICreate("test",200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 10, 10, 150, 21)

$Input2 = GUICtrlCreateInput("Autoit", 10, 35, 150, 21)
$Button = GUICtrlCreateButton("ok", 110, 60, 50, 25)
GUISetState(@SW_SHOW)

GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND')

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
WEnd

Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $chk

    $chk = BitAND($wParam, 0x0000FFFF)
    Switch $chk
        Case $Input1
            GUICtrlSetData($Input2, GUICtrlRead($Input1))
    EndSwitch
EndFunc
Link to comment
Share on other sites

I try to make something of it

this is what i made of it:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$main = GUICreate("test",200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 10, 10, 150, 21)

$Input2 = GUICtrlCreateInput("Studio", 10, 35, 150, 21)
$Button = GUICtrlCreateButton("ok", 110, 60, 50, 25)
GUISetState(@SW_SHOW)
$text1 = GUICtrlRead($Input1)

$Splittext1 = StringSplit($text1, "/")
GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND')

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
WEnd

Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $chk

    $chk = BitAND($wParam, 0x0000FFFF)
    Switch $chk
        Case $Input1

                $Splittext = StringSplit(GUICtrlRead($Input1), "/")
                GUICtrlSetData($Input2, $Splittext[2] & "Studio")

    EndSwitch
EndFunc

But when i type something in it it goes immediately wrong

what i want to do is:

What i type after the / in inputbox1 Needs to come in inputbox2

that is my problem

can anyone help me plz??

Link to comment
Share on other sites

What about this version:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$main = GUICreate("test",200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 10, 10, 150, 21)

$Input2 = GUICtrlCreateInput("", 10, 35, 150, 21)
$Button = GUICtrlCreateButton("ok", 110, 60, 50, 25)
GUISetState(@SW_SHOW)

Local $first = 0
Local $save
GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND')

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
WEnd

Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $chk, $aString

    $chk = BitAND($wParam, 0x0000FFFF)
    Switch $chk
        Case $Input1
            $aString = StringRegExp(GUICtrlRead($Input1), ".*/(.*)", 3)
            If IsArray($aString) Then
                GUICtrlSetData($Input2, $aString[0] & $save)
                $first = 1
            Else
                $first = 0
            EndIf
        Case $Input2
            If Not $first Then
                $save = GUICtrlRead($Input2)
            EndIf
    EndSwitch
EndFunc

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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