Jump to content

button


rawrr
 Share

Recommended Posts

I want a button I made to be able to, when clicked. Read a input box, and then save the text in the input box to the name of a tray icon. Any ideas? Thanks!

I want to win the lotto, but it's not going to happen unless I buy a ticket.

Show some code of what you have tried.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Was just about to edit my post..

if $savebutton = 1 Then
traycreateitem (GUICTRLREAD $namebox))
endif
if $savebutton = 1 Then
traycreateitem (GUICTRLREAD ($namebox))
endif

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Same thing? So mine works.

No I made an error in that post. Here is the corrected code

if $savebutton = 1 Then
traycreateitem ((GUICTRLREAD ($namebox))
endif

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Brain dead today. Try this and make sure that the MsgBox is displaying the proper text.

if $savebutton = 1 Then
   $tTxt = GUICtrlRead($namebox)
   MsgBox(0, "Test", $tTxt)
   traycreateitem ($tTxt)
endif

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

message box isn't even coming up.. And I think when it reads it only reads off

$Namebox = GUICtrlCreateInput("", 10, 50, 130, 20)

Whats in those quotes which is nothing.. Then how do I make it accually read the text I "Input" in the "input" box?

Link to comment
Share on other sites

  • Moderators

message box isn't even coming up.. And I think when it reads it only reads off

$Namebox = GUICtrlCreateInput("", 10, 50, 130, 20)

Whats in those quotes which is nothing.. Then how do I make it accually read the text I "Input" in the "input" box?

$sMyText = GUICtrlRead($Namebox)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Nope. Don't work.. Unless I put it in the wrong place..

Yep, you put it in the wrong place for sure.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Try learning from this, it should do what you want:

#include <GUIConstantsEx.au3>

Local $file, $btn, $msg

GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 + 90, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput("", 10, 5, 300, 20)
$btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)

GUISetState()

While 1 
    Switch GuiGetMsg()
        Case $btn
            Msgbox(0, '', GuiCtrlRead($file))
        Case $GUI_EVENT_CLOSE 
            Exit
    EndSwitch
WEnd
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Hmmm... Where to put it... Hmmm..

Dangerous question to ask around here.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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