?
Solved

How can I create an HTA with multiple tabs or windows

Posted on 2009-05-15
4
Medium Priority
?
4,978 Views
Last Modified: 2012-05-07
What I want to do is create one hta file with all my code, but have multiple windows to click through with different things in each window.  I could click an audit tab and see all of my controls, and then click another tab to change the body of the hta to other controls.  

I prefer to do this in vbscript because its what I know. Thanks !
0
Comment
Question by:heliontech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:rejoinder
ID: 24398901
Since you have not posted any code whatsoever, I can only say that this may be possible?!?  So, first post the code you want to see in an HTA.  Then when time permits, please post a screen shot or something similar with how you expect to see the HTA arranged - sometimes a picture is worth a thousand words.
0
 

Author Comment

by:heliontech
ID: 24398917
I don't have any code at the moment, I just want to know how to do it.  I was coming up with names off the top of my head.  So if anyone has a sample with even a button on each page and maybe 2 tabs at the top I can figure it out from there.
0
 
LVL 14

Accepted Solution

by:
rejoinder earned 2000 total points
ID: 24399266
I see what you want.  Tabs are tricky but here is a sample for you to play with.
<html>
<head>
<title>Tab Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body bgcolor=buttonface scroll=no topmargin=5>
 
<style type="text/css">
    div,td{cursor:default;font-size:9pt;}
</style>
 
<script language=javascript>
function TableOK(){
    var dotable,tmpcol,tmprow,docol,dorow
    if(tba[0].checked){algn="left";}
    if(tba[1].checked){algn="center";}
    if(tba[2].checked){algn="right";}
    tmpcol="<td align="+algn+"></td>";
    docol=""
    dorow=""
    for ( var i=0; i<tbc.value; i++ ){
    docol=docol+tmpcol;
    }
    docol="<tr>"+docol+"</tr>"
    for ( var j=0; j<tbr.value; j++ ){
    dorow=dorow+docol;
    }
    dotable="<table border="+tbb.value+" cellspacing="+tbs.value+" cellpadding="+tbp.value+">"+dorow+"</table>"
    alert(dotable);
    }
</script>
 
<script language=VBScript>
Sub TabStrip_Change()
    select case TabStrip.Value
        case 0
            Page1.style.visibility = "hidden"
            Page0.style.visibility = "visible"
        case 1
            Page0.style.visibility = "hidden"
            Page1.style.visibility = "visible"
    end select
end sub
</script>
 
<center>
<object id="TabStrip" classid="clsid:eae50eb0-4a62-11ce-bed6-00aa00611080" style="WIDTH: 285px; HEIGHT: 150px" >
<param name="ListIndex" value="0">
<param name="NewVersion" value="-1">
<param name="Accelerator" value="&A;B;">
<param name="TipStrings" value="Page 1;Page 2;">
<param name="Items" value="Item 1;Item 2;">
</object>
<div id="Page0" style="visibility:visible;position:absolute;left:expression((TabStrip.offsetLeft + 6) + 'px');top:expression((TabStrip.offsetTop + 30) + 'px');width:280px;height:200px;text-align:left;">
<table border=0 cellpadding=0 cellspacing=2>
<tr><td>Border:</td><td><input type=text name=tbb size=20 value="1" maxlength=2 onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" class=hole></td><td>px</td></tr>
<tr><td>Columns:</td><td><input type=text name=tbc size=20 value="2" maxlength=2 onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" class=hole></td><td>px</td></tr>
<tr><td>Rows:</td><td><input type=text name=tbr size=20 value="2" maxlength=2 onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" class=hole></td><td>px</td></tr>
</table>
</div>
<div id="Page1" style="visibility:hidden;position:absolute;left:expression((TabStrip.offsetLeft + 6) + 'px');top:expression((TabStrip.offsetTop + 30) + 'px');width:280px;height:200px;text-align:left;">
<table border=0 cellpadding=0 cellspacing=2>
<tr><td>Spacing:</td><td><input type=text name=tbs size=16 maxlength=2 value="2" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" class=hole></td><td width=85>px</td></tr>
<tr><td>Padding:</td><td><input type=text name=tbp size=16 maxlength=2 value="2" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" class=hole></td><td>px</td></tr>
<tr><td>Align:</td><td colspan=2><input type=radio name=tba checked>Left<input type=radio name=tba>Center<input type=radio name=tba>Right</td></tr>
</table>
</div>
<div align="center" style="position:absolute;left:expression((TabStrip.offsetLeft + 6) + 'px');top:expression((TabStrip.offsetTop + TabStrip.style.posHeight - 30) + 'px');width:280px;height:80px;" align="center">
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=50 align=center><input type=button onclick="window.close();" value="Close" class=cmdbtn></td>
<td width=50 align=center><input type=button onclick="TableOK();" value="OK" class=cmdbtn></td>
</tr></table>
</div>
</center>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:heliontech
ID: 31582056
Thanks ! That should get me started.
0

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question