Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dialog boxes (other then InputBox or MsgBox) 1

Status
Not open for further replies.

Rydel

Programmer
Feb 5, 2001
376
CZ
Maybe, it's a kind of basic thing, so I apologize for this newbie question. I wonder if it's possible to create more advanced dialog boxes with VBSCript in WSH environment, apart from those InputBox() and MsgBox(). Particularly, I want to have checkboxes and radio buttons. Thanks in advance! ---
---
 
Well, there are several ways to accomplish this.

One of the best (richest and most flavorful) is a thingy that MS calls an "HTML Application."

It turns out that there is a feature in late versions of IE that will cause it to run a DHTML page named like MyApp.HTA as if it was a stand-alone program instead of as a regular web page in a browser.

Now DHTML is basically:

* HTML,
* A document object model that lets you mess with the controls on an HTML page, and
* Script.

Some people throw in cascading stylesheets, but that's really more a separate topic - though distinctions become blurry.

The key is that you can write an HTA almost exactly like a VB program. Instead of a VB form you just have an HTML form instead. Then you include all the VBScript (or JScript) you want - to do whatever you want.

Note that an HTA is not limited to "web safe" operations. You can do nearly anything you can script, just like in a WSH script or a compiled program.

But enough blah, blah, blah. You need an example.

There is a simple but cool one at:


Most of this page talks about how this isn't all written up yet, "but here's the code." And at the very bottom is a link to the code.

This think has your radio buttons, command buttons, text boxes, ... even a real Windows file open dialog! With a minimum of code and hassle.

Check out MS's later as suggested at this web site. When you add HTML frames to an HTA you can do some pretty freaky stuff!

But to get started you only need to hack the sample code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top