#130245 - 2004-11-26 07:36 PM
Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
I have a simple Kixform InputBox that I can't get to work right. The box has an OK and cancel button and a box where you can type in. If you leave the text box blank and click OK, I want it to prompt you to enter a name to continue and then loop. (I have that part working). But if you click Cancel, I want the script to just end. What code do I need to get the cancel button to work? Thanks!! Here's that part of my script.
Code:
break on $=setconsole("hide")
:top $FORM = CREATEOBJECT("Kixtart.FORM")
$Name = $Form.InputBox("Enter name:", "User & PC Finder","")
IF $NAME = "" MESSAGEBOX ("You MUST Enter A Name In To Continue", "No Name Entered", 16) GOTO TOP ENDIF
|
Top
|
|
|
|
#130247 - 2004-11-26 08:23 PM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
I seen an older post with this in it:
Code:
$ButtonCancel = $FormQuestion.Button('Cancel', $ButtonOK.Right + 10, $TextBoxAnswer.Bottom + 5, 40, 16) $ButtonCancel.Cancel = 1 $ButtonCancel.OnClick = 'GOSUB ButtonCancel_Click'
But wasn't sure how/if it worked. My kixfroms.dll is showing version 2.2.0.37. Thanks!
|
Top
|
|
|
|
#130249 - 2004-11-26 10:33 PM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
What do I need to do to my script if I upgrade to the current version of Kixforms?
|
Top
|
|
|
|
#130250 - 2004-11-26 10:36 PM
Re: Kixform InputBox Cancel Button
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Probably nothing ... but give the build a try ... here it is ...
Kixforms Development Build
Let me know if your script looks/behaves the same, if so - we can talk.
|
Top
|
|
|
|
#130251 - 2004-11-26 10:39 PM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
Same thing. The only way to get out of the script is to type in something and click OK. Even typing something in and clicking Cancel just loops the script.
|
Top
|
|
|
|
#130253 - 2004-11-26 11:04 PM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
I'll be waiting! Thanks!!
|
Top
|
|
|
|
#130255 - 2004-11-26 11:19 PM
Re: Kixform InputBox Cancel Button
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Ok, download the latest DEV build again (should be special build 6), and try this script ... it uses the InputBox object, and something called the "DialogResult" property, which is documented in the old CHM ... here's the script ...
Code:
Break On
$System = CreateObject("Kixtart.System")
$InputBox = $System.InputBox()
:TOP
$Name = $InputBox.Show("Enter name:", "User & PC Finder","")
If $InputBox.DialogResult = 2 ; Cancel ?"Quiting..." Quit Endif
If $Name = "" $= MESSAGEBOX ("You MUST Enter A Name In To Continue", "No Name Entered", 16) GOTO TOP Endif
?"Name = " $Name
Exit 0
Let me know if you have any questions ...
-Shawn
|
Top
|
|
|
|
#130256 - 2004-11-26 11:30 PM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
Script error : unknown command ! $InputBox = $System.InputBox()
I got the latest build (2.4.0.46) Or do I not have the latest build?
|
Top
|
|
|
|
#130258 - 2004-11-26 11:48 PM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
Build=46
|
Top
|
|
|
|
#130261 - 2004-11-27 12:02 AM
Re: Kixform InputBox Cancel Button
|
Mike72677
Fresh Scripter
Registered: 2004-06-17
Posts: 32
Loc: PA
|
Reregistering the DLL appears to have fixed it! Cancel works GREAT now! Thanks!! All is well now for me! Works GREAT!!
|
Top
|
|
|
|
#130262 - 2004-11-27 12:52 AM
Re: Kixform InputBox Cancel Button
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
I would recommend always making sure users do the following before other trouble shooting methods.
regsvr32 /u kixforms.dll
Then delete old kixforms.dll then copy new one into %windir%\system32 (excluding Windows 9x)
Then run
regsvr32 kixforms.dll
Then run new scripts
p.s. What's with the GOTO
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 980 anonymous users online.
|
|
|