|
|
|||||||
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:
|
||||||||
|
|
|||||||
There is no way to tell if the user entered a blank value versus hitting the cancel button - what version of Kixforms you running ? |
||||||||
|
|
|||||||
I seen an older post with this in it: Code:
But wasn't sure how/if it worked. My kixfroms.dll is showing version 2.2.0.37. Thanks! |
||||||||
|
|
|||||||
The example you provided is/was from a custom hand-jobbed form, where you have to do all the work in building/driving the form. InputBox is a simpler/canned form and is easier to use. For what your doing, I would suggest sticking with InputBox. Question becomes how does one trap the cancel button ... hmmmm ... If your willing to upgrade to the latest DEV build of Kixforms ... can "fix" this up for you... |
||||||||
|
|
|||||||
What do I need to do to my script if I upgrade to the current version of Kixforms? |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
ja, you should be getting the same thing ... i'm going to enhance the development build to support detecting the cancel button, it means that you will have to do things a little different though ... but this is something i've been meaning to do for a while now, you just prompted me to actually go do it .... Will post a new build tonight hopefully ... stay tuned (if you can) ... |
||||||||
|
|
|||||||
I'll be waiting! Thanks!! |
||||||||
|
|
|||||||
don't go anywhere ... its done ... let me repost the build (5 minutes) then write a little sample script (10 minutes), be back in 15 minutes ... -Shawn |
||||||||
|
|
|||||||
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:
Let me know if you have any questions ... -Shawn |
||||||||
|
|
|||||||
Script error : unknown command ! $InputBox = $System.InputBox() I got the latest build (2.4.0.46) Or do I not have the latest build? |
||||||||
|
|
|||||||
What does this script give you ? Break On $Form = CreateObject("Kixtart.Form") ?"Build=" $Form.Build Exit 0 -Shawn |
||||||||
|
|
|||||||
Build=46 |
||||||||
|
|
|||||||
Scratching my head over this one. Can you do two things ... 1) Search your entire hard drive for instances of kixforms.dll, look to see how many you got kicking around ... 2) Go to the folder that has the latest build (look at the DLL properties and look for Special Build = 6), then re-register the dll, making sure to provide the fully qualified path to the DLL on the command-line ... |
||||||||
|
|
|||||||
Wait a sec, think i posted the wrong version of the DLL, try downloading the DEV build again and try again ... Sorry about that ... -Shawn |
||||||||
|
|
|||||||
Reregistering the DLL appears to have fixed it! Cancel works GREAT now! Thanks!! All is well now for me! Works GREAT!! |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
...and QUIT without a parm? tsk, tsk "Quitting..."? Quit 0 |
||||||||
|
|
|||||||
you boys are really ream'n the old man tonight ;0) |
||||||||
|
|
|||||||
old man huh? pfft! I think DOC is older than you and I know I am way older than DOC! |
||||||||
|
|
|||||||
Shawn, looking through your example script I noticed that you used the inputbox like this: Code: $InputBox = $System.InputBox() In one of my scripts I used the following: Code: $remotepc=$form.inputbox("Enter Remote PC Name","Remote",$lastremotepc) It been a long time since I wrote this particular script... has the syntax changed in KFs or is KFs forgiving and this was not correct to start with? |
||||||||
|
|
|||||||
They're both correct. The first version (your version) was the first InputBox that was done - and it emulates the VB one. The second one is a more "object-oriented" version of InputBox - afaik no other language or library has an InputBox quite like this one ... it allows you to specify and capture information not other-wise availble, like the dialogresult. Was meaning to have some other properties as well (like title and default), might do them this weekend. |