Solved

I'm not really sure where this quest. belongs.....

Posted on 1999-01-05
3
113 Views
Last Modified: 2010-05-03
0
Comment
Question by:groone
3 Comments
 

Expert Comment

by:DPickering
ID: 1454070
Use the TextWidth property of a Form to determine the width in pixels of some text for the Form's current font. For example:

Text1.Width = Form1.TextWidth("Blah")

Unless you're using Courier or some other fixed width font, you'll need to take into consideration the different widths for different strings even though they might be the same number of characters in length. If say the field's length is 5, I'd probably recommend finding the width of say 5 "W" or "M" (ie wide) characters to set the width of your text boxes to ensure that all of the text is visible.

Cheers,
Dave Pickering
0
 
LVL 3

Author Comment

by:groone
ID: 1454071
Nope, answer was provided.  Thanks.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 0 total points
ID: 1454072
Since the question is answered. It better to remove this question. It's also zero points so you can do it safely.

To provide a reader of this question with an answer:
use an label control with the autosize property set to true
label1.text = "Hello"
text1.text = label1.text
text1.width = label1.width

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 59
VBA: Select SQL query based on a config Sheet v2 11 44
Formula problem with Excel attachment 6 27
VB6 - Scroll Mouse wheel on Picturebox 13 44
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question