Jump to content

GUICtrlCreateButton Question


jay
 Share

Recommended Posts

Can someone send me an example of how to send data from the GUICtrlCreateInput into a .ini when you click a Save Button or any button.

Thanks

Jay

example 1

#include <GUIConstants.au3>

GUICreate("Email GUI App") ; will create a dialog box that when displayed is centered

;INIREAD ---------------------------------------------------

$Ini = "guiemail.ini"

$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")

$Ini = "guiemail.ini"

$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")

$Ini = "guiemail.ini"

$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")

$Ini = "guiemail.ini"

$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")

$Ini = "guiemail.ini"

$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")

$Ini = "guiemail.ini"

$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")

$Ini = "guiemail.ini"

$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

GUICtrlCreateLabel ("SMTP ADDRESS:", 2, 12, 100, 100, -1, -1)

$SMTPADD = GUICtrlCreateInput($SMTP, 100, 10, 150, 20)

GUICtrlCreateLabel ("USERNAME:", 2, 38, 100, 100, -1, -1) ;+26

$USERNAME = GUICtrlCreateInput ($UNAME, 100, 35, 150, 20) ;+25

GUICtrlCreateLabel ("PASSWORD:", 2, 64, 100, 100, -1, -1)

$PASSWORD = GUICtrlCreateInput ($pword, 100, 60, 150, 20)

GUICtrlCreateLabel ("TO:", 2, 90, 100, 100, -1, -1)

$TO = GUICtrlCreateInput ($TOWHO, 100, 85, 150, 20)

GUICtrlCreateLabel ("FROM:", 2, 116, 100, 100, -1, -1)

$FROM = GUICtrlCreateInput ($FROMWHO, 100, 110, 150, 20)

GUICtrlCreateLabel ("SUBJECT:", 2, 142, 100, 100, -1, -1)

$SUBJECT = GUICtrlCreateInput ($SUBWHO, 100, 135, 150, 20)

GUICtrlCreateLabel ("BODY:", 2, 168, 100, 100, -1, -1)

$BODY = GUICtrlCreateInput ($BODYWHO, 100, 160, 150, 150, $ES_MULTILINE)

GUICtrlCreateButton ("SAVE", 200, 325, 50, 20,)

GUISetState (@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Edited by jay
Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("Email GUI App") ; will create a dialog box that when displayed is centered

;INIREAD ---------------------------------------------------

$Ini = "guiemail.ini"

$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")

$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")

$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")

$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")

$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")

$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")

$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

GUICtrlCreateLabel ("SMTP ADDRESS:", 2, 12, 100, 100, -1, -1)

$SMTPADD = GUICtrlCreateInput($SMTP, 100, 10, 150, 20)

GUICtrlCreateLabel ("USERNAME:", 2, 38, 100, 100, -1, -1) ;+26

$USERNAME = GUICtrlCreateInput ($UNAME, 100, 35, 150, 20) ;+25

GUICtrlCreateLabel ("PASSWORD:", 2, 64, 100, 100, -1, -1)

$PASSWORD = GUICtrlCreateInput ($pword, 100, 60, 150, 20)

GUICtrlCreateLabel ("TO:", 2, 90, 100, 100, -1, -1)

$TO = GUICtrlCreateInput ($TOWHO, 100, 85, 150, 20)

GUICtrlCreateLabel ("FROM:", 2, 116, 100, 100, -1, -1)

$FROM = GUICtrlCreateInput ($FROMWHO, 100, 110, 150, 20)

GUICtrlCreateLabel ("SUBJECT:", 2, 142, 100, 100, -1, -1)

$SUBJECT = GUICtrlCreateInput ($SUBWHO, 100, 135, 150, 20)

GUICtrlCreateLabel ("BODY:", 2, 168, 100, 100, -1, -1)

$BODY = GUICtrlCreateInput ($BODYWHO, 100, 160, 150, 150, $ES_MULTILINE)

$SAVE = GUICtrlCreateButton ("SAVE", 200, 325, 50, 20,)

GUISetState (@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $SAVE Then

;INIWRITE ---------------------------------------------------

IniWrite($Ini, "section1", "SMTP", GUICtrlRead($SMTPADD ))

IniWrite($Ini, "section1", "USERNAME", GUICtrlRead($USERNAME))

IniWrite($Ini, "section1", "PASSWORD", GUICtrlRead($PASSWORD))

IniWrite($Ini, "section1", "TO", GUICtrlRead($TO))

IniWrite($Ini, "section1", "FROM", GUICtrlRead($FROM))

IniWrite($Ini, "section1", "SUBJECT", GUICtrlRead($SUBJECT))

IniWrite($Ini, "section1", "BODY", GUICtrlRead($BODY))

;INIWRITE ---------------------------------------------------

EndIf

Wend

Hope this will help....

Edited by Danny35d
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("Email GUI App") ; will create a dialog box that when displayed is centered

;INIREAD ---------------------------------------------------

$Ini = "guiemail.ini"

$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")

$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")

$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")

$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")

$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")

$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")

$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

GUICtrlCreateLabel ("SMTP ADDRESS:", 2, 12, 100, 100, -1, -1)

$SMTPADD = GUICtrlCreateInput($SMTP, 100, 10, 150, 20)

GUICtrlCreateLabel ("USERNAME:", 2, 38, 100, 100, -1, -1) ;+26

$USERNAME = GUICtrlCreateInput ($UNAME, 100, 35, 150, 20) ;+25

GUICtrlCreateLabel ("PASSWORD:", 2, 64, 100, 100, -1, -1)

$PASSWORD = GUICtrlCreateInput ($pword, 100, 60, 150, 20)

GUICtrlCreateLabel ("TO:", 2, 90, 100, 100, -1, -1)

$TO = GUICtrlCreateInput ($TOWHO, 100, 85, 150, 20)

GUICtrlCreateLabel ("FROM:", 2, 116, 100, 100, -1, -1)

$FROM = GUICtrlCreateInput ($FROMWHO, 100, 110, 150, 20)

GUICtrlCreateLabel ("SUBJECT:", 2, 142, 100, 100, -1, -1)

$SUBJECT = GUICtrlCreateInput ($SUBWHO, 100, 135, 150, 20)

GUICtrlCreateLabel ("BODY:", 2, 168, 100, 100, -1, -1)

$BODY = GUICtrlCreateInput ($BODYWHO, 100, 160, 150, 150, $ES_MULTILINE)

$SAVE = GUICtrlCreateButton ("SAVE", 200, 325, 50, 20,)

GUISetState (@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $SAVE Then

;INIWRITE ---------------------------------------------------

IniWrite($Ini, "section1", "SMTP", GUICtrlRead($SMTPADD ))

IniWrite($Ini, "section1", "USERNAME", GUICtrlRead($USERNAME))

IniWrite($Ini, "section1", "PASSWORD", GUICtrlRead($PASSWORD))

IniWrite($Ini, "section1", "TO", GUICtrlRead($TO))

IniWrite($Ini, "section1", "FROM", GUICtrlRead($FROM))

IniWrite($Ini, "section1", "SUBJECT", GUICtrlRead($SUBJECT))

IniWrite($Ini, "section1", "BODY", GUICtrlRead($BODY))

;INIWRITE ---------------------------------------------------

EndIf

Wend

Hope this will help....

Hey Thanks this worked i now have a better understanding of it to

Thanks Again

Jay

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