Support Forums

Full Version: [code help] VBscript InputBox Cancel If Statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I posted this thread on HF, VBForums and now SF. And I highly doubt anybody can help me, but that would be miraculous.


Does anybody know how to use result of if the user canceling the InputBox, or Xing it out? Like this:

Code:
Dim objShell
  objShell = CreateObject("Wscript.Shell")
  Dim Wscript
  Wscript = CreateObject("Wscript.Shell")
If GetObject("blablabla").Something(InputBox("Hello World", "Enter a Response:", "<ENTER RESPONSE HERE>"), 0, 100) = InputBox.Result = Cancel Then
    End If

But clearly that code wouldn't work. Still not understanding? Check this out:
[Image: bd448a9d0ba4d224ad773a8ca742ac75.png]
[Image: f6587d69ebefe7257a19df6c95d41d9e.png]
The code for the picture above:
Code:
If MsgBox("Cancel the current operation?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
  Else
    e.Cancel = True
  End If

You see what I am getting at? Please help me, I do not specialize in MessageBoxes in VB.

The ANSWER TO THIS ALL:
[Image: d49ab706668edbd93c31328940fb82c6.png]
Saw that you got you thread answered on HF. You might post the code on here in case someone on SF wants to know this as well.
(04-10-2011, 03:00 PM)KoBE Wrote: [ -> ]Saw that you got you thread answered on HF. You might post the code on here in case someone on SF wants to know this as well.

Yeah plus rep the guy for me by +3

http://www.hackforums.net/member.php?act...uid=511162