In an HTA, I need a control or other object that can grow and shrink based on
its contents; I need this to stay on one line; the user cannot edit it, but
it needs to be accessible for read/write from VBScript.

The contents will be a string network path to a folder selected by the user
(I can already do this part), thus the varying lengths needed.

What is the best control/tool to use for this? Can an example for read/write
please be included?

Thank you very much.

Re: Auto sizing control to display a path by mr_unreliable

mr_unreliable
Thu May 10 15:40:59 CDT 2007

XP wrote:
> In an HTA, I need a control or other object that can grow and shrink based on
> its contents

hi XP,

If you put your string in an ordinary paragraph, it will adjust
it's size according to the length of the string.

If you want something that looks like a "textbox" (or edit
control), then you could use an input tag, and size it with
css. You could do that by getting the string length with
the "Len" function. Then set up your input box, with a
"fixed pitch" font, where you know the size of each character.
Then calculate the size of the box, by multiplying the
character size by the number of chars. Then size your box
using css.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)





Re: Auto sizing control to display a path by Michael

Michael
Thu May 10 18:45:19 CDT 2007

XP wrote:
> In an HTA, I need a control or other object that can grow and shrink
> based on its contents; I need this to stay on one line; the user
> cannot edit it, but it needs to be accessible for read/write from
> VBScript.
>
> The contents will be a string network path to a folder selected by
> the user (I can already do this part), thus the varying lengths
> needed.
>
> What is the best control/tool to use for this? Can an example for
> read/write please be included?
>
> Thank you very much.

A span with an id...

mySpan.innerText = "some path"
thePath = mySpan.innerText

--
Michael Harris
Microsoft.MVP.Scripting



Re: Auto sizing control to display a path by Ayush

Ayush
Fri May 11 04:01:36 CDT 2007

[mr_unreliable]s message :
> If you want something that looks like a "textbox" (or edit
> control), then you could use an input tag, and size it with
> css. You could do that by getting the string length with
> the "Len" function. Then set up your input box, with a
> "fixed pitch" font, where you know the size of each character.
> Then calculate the size of the box, by multiplying the
> character size by the number of chars. Then size your box
> using css.


There is no need to use CSS for this, the OP can use the SIZE property of INPUT:Text
element:

"""
For the INPUT type=text object, the size is in characters and represents the width of
the text box.
"""
Good Luck, Ayush.
--
Setup Outlook Express to read MS Newsgroups :
http://www.microsoft.com/windows/ie/support/newsgroups/howto.mspx