Mombu the Microsoft Forum

Mombu the Microsoft Forum > Microsoft > Windows 2003 Server (TECHNET) > Reposition and/or resize controls on the fly
REGISTER NOW! Search Today's Posts Mark Forums Read




Reply
 
Thread Tools Search this Thread Display Modes
1 3rd May 22:12
xp
External User
 
Posts: 1
Default Reposition and/or resize controls on the fly



In an HTA, is it possible to re-position and/or resize controls, like buttons
and list boxes on the fly?

If so, could someone please post example code as to how to do it?

Thanks for your help...
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


2 15th July 20:56
ayush
External User
 
Posts: 1
Default Reposition and/or resize controls on the fly



[XP]s message :

Yes, use CSS. e.g. To change width/height - use element.style.width=NEW_WIDTH
To move an element, you can use Position -absolute/relative with left,top etc.:
http://www.barelyfitz.com/screencast...s/positioning/
http://www.tizag.com/cssT/position.php

You can also reappend the element to move it
e.g. move an input box before a select element:
mySelect.parentElement.insertBefore(inputElem,mySe lect)

<script language="vbscript">

Sub resizeElem
mySelect.style.width="100px"
End Sub

Sub moveInput
inputElem.style.position="relative"
inputElem.style.left="22px"
End Sub
</script>

<select id="mySelect">
<option>A
<option>B
<option>C
</select><br>
<button onclick="resizeElem">Resize the select</button>
<br><br>
<input id="inputElem"><br>
<button onclick="moveInput">Move input</button>
  Reply With Quote
3 15th July 21:22
ayush
External User
 
Posts: 1
Default Reposition and/or resize controls on the fly


[XP]s message :

Yes, use CSS. e.g. To change width/height - use element.style.width=NEW_WIDTH
To move an element, you can use Position -absolute/relative with left,top etc.:
http://www.barelyfitz.com/screencast...s/positioning/
http://www.tizag.com/cssT/position.php

You can also reappend the element to move it
e.g. move an input box before a select element:
mySelect.parentElement.insertBefore(inputElem,mySe lect)

<script language="vbscript">

Sub resizeElem
mySelect.style.width="100px"
End Sub

Sub moveInput
inputElem.style.position="relative"
inputElem.style.left="22px"
End Sub
</script>

<select id="mySelect">
<option>A
<option>B
<option>C
</select><br>
<button onclick="resizeElem">Resize the select</button>
<br><br>
<input id="inputElem"><br>
<button onclick="moveInput">Move input</button>
  Reply With Quote
4 15th July 21:58
xp
External User
 
Posts: 1
Default Reposition and/or resize controls on the fly


Hi Ayush,

As usual, awesome assistance! Thanks!
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


5 16th August 22:28
ayush
External User
 
Posts: 1
Default Reposition and/or resize controls on the fly


[XP]s message :


You're welcome XP.

Good Luck, Ayush.
--
XP-Tips & Tricks [Use keyboard shortcuts] :
http://www.microsoft.com/windowsxp/u...shortcuts.mspx
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes







Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
Also visit Ogoun the Usenet Archive
666