Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Script Demonstrating DIV tags in HTA

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,53534
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Script Demonstrating DIV tags in HTA
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Script Demonstrating DIV tags in HTA - 11/13/2007 11:50:57 PM   
  Meg


Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
My last script used DIV tags and I am impressed with the extra flexibility I now have over the design of my scripts.

This example script is heavily commented so I am sure you will find it useful if you are interested in implementing features like this into your scripts. 


-Create a new file on your computer called DIVHTA.HTA and paste the attached code into it. 
 -Run DIVHTA.HTA 
 -Usage instructions are displayed in Program.


Enjoy




      

< Message edited by Meg -- 11/14/2007 11:40:46 PM >
 
 
Revisions: 7 | Post #: 1
 
 RE: Script Demonstrating DIV tags in HTA - 11/14/2007 5:00:29 AM   
  ehvbs

 

Posts: 2012
Score: 48
Joined: 6/22/2005
From: Germany
Status: offline
Hi Meg,

as dm_4ever said regarding your GoogleMap .hta: very nice and interesting code.

Just one nit to pick:

   The script section should be part of the head.

two suggestions:

   By moving the .resizeto code (in a tag of its own) before the hta tag, you could
   avoid flickering (this method is (c) M. Harris)

   Make the ref to c:\windows\Prairie Wind.bmp a (configurable) constant; that will
   help foreigners to switch to c:\winnt\Präriewind.bmp

and one typo (?)

  <a href="By'>http://www.painterinfo.com/php2bb/">By MJP 2007</a>
==>
  <a href="http://www.painterinfo.com/php2bb/">By MJP 2007</a>

Thanks for the inspiring sample!

ehvbs

  

(in reply to Meg)
 
 
Post #: 2
 
 RE: Script Demonstrating DIV tags in HTA - 11/14/2007 9:58:03 AM   
  Meg


Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
Thanks for the feedback. I really appreciate that.  Your comments have really lifted the script.
I have fixed those things you mentioned but am stumped on how to make that image a configurable variable.

I can't use <span> because it is within a DIV tag and I even tried the asp trick of <%response.write MyImg%>
I could have tried making the entire DIV tag a span but that makes the script harder to understand etc.

< Message edited by Meg -- 11/14/2007 9:40:59 PM >

(in reply to ehvbs)
 
 
Revisions: 1 | Post #: 3
 
 RE: Script Demonstrating DIV tags in HTA - 11/14/2007 11:25:19 PM   
  ehvbs

 

Posts: 2012
Score: 48
Joined: 6/22/2005
From: Germany
Status: offline
Hi Meg,

defining 
   
   Const sBGBmp = "url(c:\winnt\PrärieWind.bmp)"

at the top (first script section) and extending your method of run time style manipulation

   Splash.Style.Display = "inline"
   Splash.Style.BackgroundImage = sBGBmp

worked for me (W2K, IE 6).

Regards (and good luck with IE 7 and Vista)

ehvbs

(in reply to Meg)
 
 
Post #: 4
 
 RE: Script Demonstrating DIV tags in HTA - 11/14/2007 11:54:57 PM   
  Meg


Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
Hi ehvbs,

That works well and also hints at other .style. features being able to be manipulated from script, which is good.

Thanks.

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: Script Demonstrating DIV tags in HTA - 11/16/2007 12:30:49 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Very nice.  Where were you on Monday when I was trying to figure out something similiar?  But this is a nicer way than what I was doing, will see about using some of your methods.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Meg)
 
 
Post #: 6
 
 RE: Script Demonstrating DIV tags in HTA - 11/16/2007 1:59:35 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Started playing with your code to understand it better to enable me to add features to my HTA and I started wondering if the Runbuttonx's were a little redundunt.  So, I took a look at trying to do them a little different and this is what I came up with .

Add this section above the Splash Div and Remove all the button groupings in the divs.


      


Add this Sub

      

In the Subs, replace any 4 grouping
run_button13.disabled = false
run_button14.disabled = false
run_button15.disabled = false
run_button16.disabled = true
With

SetButton(x) where x is the button you want to disable.

Here is the full code.  Once again, excellent job.


      

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to mbouchard)
 
 
Post #: 7
 
 RE: Script Demonstrating DIV tags in HTA - 11/16/2007 2:48:07 PM   
  Meg


Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
Thanks for the complement and the refinements Mike. 

That mod makes it  much more elegant.

(in reply to mbouchard)
 
 
Post #: 8
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Script Demonstrating DIV tags in HTA Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts