Jump to content

A way to remove GuiCtrlCreateInput?


OrcTamer
 Share

Recommended Posts

#include <GUIConstants.au3>
GUICreate("Orc_Tamer's Auto Resizer", 400, 200)
GuiSetIcon(@SystemDir & "\mspaint.exe", 0)
GUISetState(@SW_SHOW)
GuiCtrlCreatecombo("Select Image Format", 250, 92, 120, 100)
GUICtrlSetData(-1,"GIF|JPEG|PNG|BMP")
$Button_1 = GUICtrlCreateButton ("Browse",  155, 90, 80)
$Button_2 = GUICtrlCreateButton ("Submit",  155, 150, 80)
GuiCtrlCreateLabel("(You can enter a file extension like ''C:\WINDOWS\Image.jpg'' or browse for image)", 3, 50)
GuiCtrlCreateLabel("Created by Efren Palacios", 265,180)
$input = GuiCtrlCreateInput("", 5, 90, 150)
$thumbnameandpath = ControlGetText("MS Paint Auto Resizer" , "" , "Edit1") 
$digitsinthumbpath = StringLen($thumbnameandpath)
$numberfromleftinfilename = StringInStr($thumbnameandpath, "\" ,0, -1)
$OriginalFNNoPath= stringtrimleft($thumbnameandpath, $numberfromleftinfilename)
$cutthumbextension = StringTrimRight($thumbnameandpath, 4)
$newthumbname = Random(1, 60000) & "_thumb.jpg"
   
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            $message = "Choose your Image"

$var = FileOpenDialog($message, "C:\Documents and Settings\Owner\My Documents\", "Images (*.jpg;*.bmp;*png;*.bmp)", 1 + 4 )

If @error Then
    MsgBox(4096,"","No File(s) chosen")
Else
    $var = StringReplace($var, "|", @CRLF)
    $input = 
    $input = GuiCtrlCreateInput($var, 5, 90, 150)
EndIf       
    EndSelect
Wend

Is there a way to remove the one I had previously? Since I want it to display an extension of the image they put on the input box.

Else

$var = StringReplace($var, "|", @CRLF)

$input = ;this one right here... can I add something? to remove the previously input box I made?

$input = GuiCtrlCreateInput($var, 5, 90, 150)

EndIf

Link to comment
Share on other sites

You would delete the control like this:

Else
$var = StringReplace($var, "|", @CRLF)
GUICtrlDelete ( $input )
$input = GuiCtrlCreateInput($var, 5, 90, 150)
EndI

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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