Jump to content
Sign in to follow this  
SmokNiszczyciel

Text in GUI

Recommended Posts

SmokNiszczyciel

I have problem - I don't know how to do this but I know it's possible -

how to make a GUI with textbox and some buttons - u press one button then new GUI window pops up and u can edit some things like check this box, then add text there and choose it from combobox, after u finisht u press button "ADD" and in main GUI window in the text window will be text u have added

So how to do this?:blink:

Share this post


Link to post
Share on other sites
sleepydvdr

is this what you are asking for?

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 443, 161, -1, -1)
$Button1 = GUICtrlCreateButton("Button1", 344, 16, 75, 25, 0)
$Button2 = GUICtrlCreateButton("Button2", 344, 56, 75, 25, 0)
$Button3 = GUICtrlCreateButton("Add", 312, 112, 75, 25, 0)
$Input1 = GUICtrlCreateInput("Type something here", 40, 112, 249, 21)
$Label1 = GUICtrlCreateLabel("Label1", 40, 48, 212, 17)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $a = GUICreate("Form2", 443, 161, 100, 100)
            GUISetState(@SW_SHOW)
            $Label1 = GUICtrlCreateLabel("Popup box #1", 40, 48, -1, -1)
            sleep (2000)
            GUIDelete($a)
        Case $Button2
            $b = GUICreate("Form3", 443, 161, 200, 200)
            GUISetState(@SW_SHOW)
            $Label1 = GUICtrlCreateLabel("Popup box #2", 40, 48, -1, -1)
            sleep (2000)
            GUIDelete($b)
        Case $Button3
            $read = GUICtrlRead ($Input1)
            $Label1 = GUICtrlCreateLabel($read, 40, 48, 212, 17)
    EndSwitch
WEnd
Edited by sleepydvdr

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
SmokNiszczyciel

"u press button "ADD" and in main GUI window in the text window will be text u have added" - i need to know how to make such thing - u click button1 and in text window will appear some editable text and after u click button "SAVE SCRIPT" then it will make a .xml file with text from text window

Share this post


Link to post
Share on other sites
sleepydvdr

I'm not exactly sure what it is you need, but I will try to help with individual parts. Here's a script where you have an input box and when you click the button, it creates an XML file on your desktop and writes what you typed to the file.

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 443, 161, -1, -1)
$Button1 = GUICtrlCreateButton("Button1", 344, 128, 75, 25, 0)
$Edit1 = GUICtrlCreateEdit("", 16, 8, 409, 113)
GUICtrlSetData(-1, '<?xml version="1.0"?>' & @CRLF & '<!DOCTYPE TEST "test.dtd">' & @CRLF & '<?xml-stylesheet type="text/css" href="xmlteststyle.css"?>')

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            FileCopy ("", @DesktopDir & "\XML File.xml", 8)
            $read = GUICtrlRead ($Edit1)
            FileWrite(@DesktopDir & "\XML File.xml", $read)
    EndSwitch
WEnd

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
SmokNiszczyciel

but i want script write text to input box, example:

i have few buttons in GUI, few checkboxes, and few inputs - i check this box write this text and press button "ADD" and script adds text to inputbox

Share this post


Link to post
Share on other sites
SmokNiszczyciel

but i want script write text to input box, example:

i have few buttons in GUI, few checkboxes, and few inputs - i check this box write this text and press button "ADD" and script adds text to inputbox

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.