473,326 Members | 2,127 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,326 software developers and data experts.

Measure a string

pnp
Hi all,

Is there a way to get a strings' width without using the
Graphics.MeasureString() Method?

Thanks in advance,
Peter.
Nov 16 '05 #1
3 1905
Hi,

Why do you want another way? The size of a string is only applicable when
drawing.

Chris

"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi all,

Is there a way to get a strings' width without using the
Graphics.MeasureString() Method?

Thanks in advance,
Peter.

Nov 16 '05 #2
pnp
Because pending on the string size a label will be resized to fit it inside
and then a form will be resized to fit the label (and reorder other
controls). The problem is that call the MeasureString() only when the form
is Painted (OnPaint) so the form and it's contents can be seen while
resizing....

Is there a way to reorder and resize the form before it is shown?

Peter.

"Christopher Kimbell" <a@b.c> wrote in message
news:40********@news.broadpark.no...
Hi,

Why do you want another way? The size of a string is only applicable when
drawing.

Chris

"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi all,

Is there a way to get a strings' width without using the
Graphics.MeasureString() Method?

Thanks in advance,
Peter.


Nov 16 '05 #3
From what I understand you are experiencing flicker when drawing.
Have a look at the SetStyle() method of the Control class, it allows you to
enable double buffering and specify drawing options.

Chris

"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Because pending on the string size a label will be resized to fit it inside and then a form will be resized to fit the label (and reorder other
controls). The problem is that call the MeasureString() only when the form
is Painted (OnPaint) so the form and it's contents can be seen while
resizing....

Is there a way to reorder and resize the form before it is shown?

Peter.

"Christopher Kimbell" <a@b.c> wrote in message
news:40********@news.broadpark.no...
Hi,

Why do you want another way? The size of a string is only applicable when drawing.

Chris

"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi all,

Is there a way to get a strings' width without using the
Graphics.MeasureString() Method?

Thanks in advance,
Peter.



Nov 16 '05 #4

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

Similar topics

13
by: Chiller | last post by:
I'm now getting close to finishing my Distance class. In the code below I have included a number of overload operators that test for equality etc. I've also added more code in the TEST_DISTANCE...
7
by: Peng Yu | last post by:
Hi, For example, there is a function which is called many times from different places in a program. I want measure how long this function runs in total. Of course, I can use gettimeofday to...
2
by: Bond | last post by:
Hi! I'd like to measure the performance of my web page. I'd like to set a timer on the page to start when a user clicks on a link, or submit... anything where the browser requests a page from the...
2
by: AlirezaH | last post by:
How to measure hard disk capacity?
5
by: Joe Fallon | last post by:
Is there a good way to measure the size of a page delivered to the browser? Also, how do measure the size of Viewstate? I am just using View Source, saving the text file and looking at the number...
6
by: Scirious | last post by:
People, how can I know how big an object is? I mean, I have an object the collects data from a stream and when it grows to an especific size I need to create a new object to continue collecting the...
14
by: asit dhal | last post by:
Can anyone tell how to measure the size of an array without use of sizeof operator ?
3
by: mrpeter05 | last post by:
I can not find a way to measure the height of a string by setting a maximum width! I need the strings maximum width to be the width of the screen and want to use that to calculate the height. Is...
4
by: halimunan | last post by:
Hello all, I have a question, how do i measure the download/upload speed... as if download rate, upload rate or kbps transfer rate. i want to do my own windows application using C# to measure the...
4
by: Academia | last post by:
I need to create a Bitmap just big enough to display a string. Since I need a Graphic object to measure the string I create and dispose a Bitmap and a Graphic object only for that purpose. ...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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

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.