473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Points, Pixels and string lengths


I am creating text box controls "on the fly" for strings
of varying lengths. I want to make the text box size
match the size of the string. How do I convert the length
of the string (len) to pixels, which is required by Size.
The Font is sized in Point.

aTextBox.Size = new System.Drawing.Size((len * ??? ), 20);
Nov 15 '05 #1
1 2636
You can get the size of a string drawn with a given font with
Graphics.MeasureString();

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Kamilche | last post by:
I was looking for a way to speed up detecting invalid characters in my TCP string, and thought of yet another use for the translate function! If you were to 'translate out' the bad characters, and...
0
by: Tom Warren | last post by:
I found a c program called similcmp on the net and converted it to vba if anybody wants it. I'll post the technical research on it if there is any call for it. It looks like it could be a useful...
46
by: yadurajj | last post by:
Hello i am newbie trying to learn C..I need to know about string comparisons in C, without using a library function,...recently I was asked this in an interview..I can write a small program but I...
12
by: Tee | last post by:
String Builder & String, what's the difference. and when to use which ? Thanks.
13
by: T.Jackson | last post by:
Hi guys, Does anyone know the conversions for the above (relationship between each of the above). Ie how many points makeup a pixel & how many pixels make up a point. -- Besty Regards, TJ
12
by: Laphan | last post by:
Hi All Strange question this, but could somebody tell me what the old size=1, size=2 .... to size=7 font parameters are in pixels and points. I thought it was: size 1 = 7 pt size 2 = 14...
3
by: Iwanow | last post by:
Hello! My goal is to develop a program that opens a bitmap, copies its pixels to an ArrayList in order to perform some complex calculations (edge detection, Hough transform etc.), and save...
1
by: Nitzan Tomer | last post by:
hi everyone, i created a script that outputs an image (transparent with text) based on parameters passed by $_GET. everything in my application works with 'pixels' and since GD2 this function...
4
by: David24 | last post by:
i am modifying a simple motion detector from the Aforge Library. It simply compares 2 frames and draws the difference as semitransparent red pixels. I need to store the (constantly changing) average...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.