Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
HTA Script, center button on form?
Logged in as: Guest
arrSession:exec spGetSession 2,7,50238
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[General Forum]
>>
Other Programming/Scripting Languages
>> HTA Script, center button on form?
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 >>
HTA Script, center button on form? -
8/1/2007 8:59:20 AM
simonc1970
Posts: 13
Score: 0
Joined: 5/7/2007
Status:
offline
Hello, can anyone tell me how to make the reboot button in my HTA script be centered on the from when it loads?
<html>
<head>
<title>Boehringer Ingelheim Image Download PE4</title>
<HTA:APPLICATION
ID="MapShare"
INNERBORDER="no"
BORDER="dialog"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
CONTEXTMENU="no"
APPLICATIONNAME="MapShare"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
</head>
</Script><Body>
<P>
<body STYLE="font:13 pt arial; color:white;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0, StartColorStr='#000000', EndColorStr='#0000FF')" onContextMenu="copyRight">
<BR>
<BR>
<input id=runbutton class="button" type="button" value="Reboot Computer" name="ok_button"
onClick="RunReboot">
 
</BODY>
Post #: 1
RE: HTA Script, center button on form? -
8/1/2007 11:11:28 AM
dm_4ever
Posts: 2434
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status:
offline
You mean like this...
<html> <head> <title>Boehringer Ingelheim Image Download PE4</title> <head> <script></script> <HTA:APPLICATION ID="MapShare" INNERBORDER="no" BORDER="dialog" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" CONTEXTMENU="no" APPLICATIONNAME="MapShare" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="maximize" > </head> <body> <P> <body STYLE="font:13 pt arial; color:white; filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#000000', EndColorStr='#0000FF')" onContextMenu="copyRight"> <BR> <BR> <div align="center"><input id=runbutton class="button" type="button" value="Reboot Computer" name="ok_button" onClick="RunReboot"></div>   </body> </html>
_____________________________
dm_4ever
My philosophy:
K.I.S.S - Keep It Simple Stupid
Read Me:
http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff:
http://www.visualbasicscript.com/m_47117/tm.htm
(in reply to
simonc1970
)
Post #: 2
RE: HTA Script, center button on form? -
8/1/2007 12:42:26 PM
Rischip
Posts: 468
Score: 2
Joined: 3/26/2007
Status:
offline
That will work centered left to right.
This will work absolute center and will adjust where center is when a resize event occurs.
<html> <head> <title>Boehringer Ingelheim Image Download PE4</title> <HTA:APPLICATION ID="MapShare" INNERBORDER="no" BORDER="dialog" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" CONTEXTMENU="no" APPLICATIONNAME="MapShare" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="maximize" > <script language=vbscript> Sub Window_Onload posBtn document.body.onresize = GetRef("posBtn") End Sub Sub posBtn Dim btn Set btn=document.getelementbyid("runbutton") Set bod=document.getelementbyid("mainbody") topLoc = (bod.offsetHeight/2) - (btn.offsetHeight/2) leftLoc = (bod.offsetWidth/2) - (btn.offsetWidth/2) btn.style.position="absolute" btn.style.posTop = topLoc btn.style.posLeft = leftLoc End Sub </Script> </head> <body id="mainbody" STYLE="font:13 pt arial; color:white; filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#000000', EndColorStr='#0000FF')" onContextMenu="copyRight"> <BR> <BR> <input id=runbutton type="button" value="Reboot Computer" name="ok_button" onClick="RunReboot"> </body> </html>
_____________________________
Rischip
Author of - The Grim Linker
(in reply to
dm_4ever
)
Post #: 3
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[General Forum]
>>
Other Programming/Scripting Languages
>> HTA Script, center button on form?
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
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
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI