• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 612
  • Last Modified:

VB.NET 2003 InputBox doesn't resize to fit its text

In a VB.NET 2003 WinForm application, I get input from the user using the InputBox method. The problem is that the text in the InputBox doesn't fit (I have about 7 lines of text). It looks like the InputBox dialog is of fixed size and does not resize to fit its text. Does anyone know how to solve this?

The code is:

Dim sText As String

sText = InputBox ("Please contact us at:" & vbCrLf & vbCrLf & "Tel: (012) 345 6789" & vbCrLf & "Fax: (012) 345 6789" & vbCrLf & "E-Mail: someone@somewhere.com" & vbCrLf & "Website: www.mysite.com"

Thanks
0
SETP
Asked:
SETP
  • 3
  • 2
1 Solution
 
Arthur_WoodCommented:
You should *not* be using the InputBox function in any .NET application.  You should design your own input form, which you can then control completely, to interact with the user, and request information.

AW
0
 
SETPAuthor Commented:
Thanks for your reply Arthur_Wood. So there's no .NET equivalent for the VB6 InputBox at all? That seems like a step back...
0
 
Arthur_WoodCommented:
InputBox was a *kluge* that IMHO should never have been included in VB, from the very beginning.  No, as far as I am aware, there is no fully .NET version.  The InputBox that you are using is accessed via the Microsoft.VisualBasic namespace.  The real problem with the InputBox is that the returned value is *always* a String, even when the user enteres Numbers. And you cannot easily request Dates, or anything else from the user.  It also makes validation of the user entry very cumbersome, since you must write the validation code in the calling routine, and if the user made an invalid entry, then you must redisplay the InputBox.  That type of validation is much cleaner and more specific if you create your own input form, do the necessary validation, in the code of the form, and only return valid results to the caller.

AW
0
 
SETPAuthor Commented:
Makes sense... Thanks Arthur
0
 
Arthur_WoodCommented:
glad to help.  Designing your ouw forms is much better, in terms of how your application interacts with the end users.  It just makes the application look more 'professional'.

AW
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now