By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Retrieving the InputBox width and height

P: n/a
Is it possible to retrieve the width and height of an InputBox so I can
mathmatically center it in the current form if the form is not centerscreen?
If so, what are the properties or how is it accomplished? I guess I could
create my own form but would like to not have to.

Thank you,
John
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* "jcrouse" <me> scripsit:
Is it possible to retrieve the width and height of an InputBox so I can
mathmatically center it in the current form if the form is not centerscreen?
If so, what are the properties or how is it accomplished? I guess I could
create my own form but would like to not have to.


That's AFAIK not possible. And even if it was possible, I would write
my replacement if it should be deployed. Currently, there is no way to
check if the user pressed "Cancel" or simply entered no text and pressed
"OK". In localized versions of the .NET Framework, the localized text
for "Cancel" (in German "Abbrechen") doesn't fit on the button and the
button looks horrible.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #2

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Og**************@TK2MSFTNGP09.phx.gbl...
Is it possible to retrieve the width and height of an InputBox so I can
mathmatically center it in the current form if the form is not centerscreen? If so, what are the properties or how is it accomplished? I guess I could create my own form but would like to not have to.


That's AFAIK not possible. And even if it was possible, I would write
my replacement if it should be deployed. Currently, there is no way to
check if the user pressed "Cancel" or simply entered no text and pressed
"OK". In localized versions of the .NET Framework, the localized text
for "Cancel" (in German "Abbrechen") doesn't fit on the button and the
button looks horrible.


To sum up what Herfried said, and what I've said for years: InputBox()
SUCKS! It sucks as bad in .NET as it has in all previous versions of VB. You
shouldn't use it for anything more than quick-and-dirty testing.
Nov 20 '05 #3

P: n/a
Jeff,

* "Jeff Johnson" <i.***@enough.spam> scripsit:
That's AFAIK not possible. And even if it was possible, I would write
my replacement if it should be deployed. Currently, there is no way to
check if the user pressed "Cancel" or simply entered no text and pressed
"OK". In localized versions of the .NET Framework, the localized text
for "Cancel" (in German "Abbrechen") doesn't fit on the button and the
button looks horrible.


To sum up what Herfried said, and what I've said for years: InputBox()
SUCKS! It sucks as bad in .NET as it has in all previous versions of VB. You
shouldn't use it for anything more than quick-and-dirty testing.


Full ACK. In .NET 2.0 InputBox provides improved functionality! It's
possible to determine if the user pressed "Cancel" by checking the
return value ('Nothing' -> user pressed "Cancel").

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #4

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uD**************@TK2MSFTNGP10.phx.gbl...
To sum up what Herfried said, and what I've said for years: InputBox()
SUCKS! It sucks as bad in .NET as it has in all previous versions of VB. You shouldn't use it for anything more than quick-and-dirty testing.


Full ACK. In .NET 2.0 InputBox provides improved functionality! It's
possible to determine if the user pressed "Cancel" by checking the
return value ('Nothing' -> user pressed "Cancel").


Gee, I'm thrilled the VB team expended energy on that.... I'll have to smack
someone around at the next summit.
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.