Hi,
MFC has functions that calculate the width and height of a
text string, GetTextExtent being one of them. Does .NET/C#
have an equivalent?
Or how does one do this in C#?
Thanks,
Gary 3 3684
Hi,
Systrem.Drawing.Graphics.MeasureString(...)
--
Milosz Skalecki
MCP, MCAD
"Gary Brown" wrote: Hi,
MFC has functions that calculate the width and height of a text string, GetTextExtent being one of them. Does .NET/C# have an equivalent?
Or how does one do this in C#?
Thanks, Gary
I can see that .net is going to be fun.
I need the length of a string so I start with SystemDrawing, but I'm not
drawing anything.
Then I use Graphics but to me a string is not graphics.
Then finally I MeasureString.
My concept of logic goes right out the window.
Galen S
"Milosz Skalecki" <mi*****@REMOVEITwp.pl> wrote in message
news:5C**********************************@microsof t.com... Hi, Systrem.Drawing.Graphics.MeasureString(...) -- Milosz Skalecki MCP, MCAD
"Gary Brown" wrote:
Hi,
MFC has functions that calculate the width and height of a text string, GetTextExtent being one of them. Does .NET/C# have an equivalent?
Or how does one do this in C#?
Thanks, Gary
Sorry, but i don't understand your complaint :). You wanted an equivalent of
the GetTextExtent function which computes the width and height of a line of
text using the current font. If you want just a length of a string just use
MyStringInstance.Length :)
Regards
--
Milosz Skalecki
MCP, MCAD
"Galen Somerville" wrote: I can see that .net is going to be fun. I need the length of a string so I start with SystemDrawing, but I'm not drawing anything.
Then I use Graphics but to me a string is not graphics.
Then finally I MeasureString.
My concept of logic goes right out the window.
Galen S
"Milosz Skalecki" <mi*****@REMOVEITwp.pl> wrote in message news:5C**********************************@microsof t.com... Hi, Systrem.Drawing.Graphics.MeasureString(...) -- Milosz Skalecki MCP, MCAD
"Gary Brown" wrote:
Hi,
MFC has functions that calculate the width and height of a text string, GetTextExtent being one of them. Does .NET/C# have an equivalent?
Or how does one do this in C#?
Thanks, Gary This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Joe Patrick |
last post by:
On my websites index.html page I have this script:
<SCRIPT language="JavaScript">
<!-- //
if ((screen.width==1024) && (screen.height==768))
{
document.write('<a href="active.html">Click here</a>...
|
by: Billy |
last post by:
Hi,
This is in connection to the tread: Re: changing browser text settings??
I am wondering if there is a way to retrieve the browsers text size (not
change! ;-) ) so that I can dynamically...
|
by: Marti |
last post by:
Dear everyone,
Its my understanding that IE6 now uses a default text-size of "Small"
rather than IE5's "Medium".
Since I have used relative font-sizes (usually in ems) on all my
sites, I am...
|
by: Peter |
last post by:
Hi at all,
how can I do to make a css file to change automatically the text size of the
text that is into a table relatively the screen size?
I.E. if the screen is 800 x I want the text...
|
by: Der Kommissar |
last post by:
Hi all
I've been working on a site, in which I had to use tables for layout,
but I've used CSS to style the text and a few other things.
http://www.cultuurnet.be/
The site seems to work as...
|
by: dmsy |
last post by:
Is there a way to use javascript to increase the overall document text
size, just like if you click View->Text Size->Largest, Larger, Medium,
Smaller, Smallest? This is on IE browser.
|
by: Roger Withnell |
last post by:
How to I find out what size text the browser is set to?
Thanks in anticipation.
|
by: ghall426 |
last post by:
I've read numerous articles about the font-size problems, but am confused about a couple of things. I'm using Microsoft Expression Web. The drop-down box that lets me select text size shows medium...
|
by: Deepan HTML |
last post by:
I am having a html code like below:
<tr><td bgcolor=#5CB3FF><h6>(Tentative)</h6></td></tr>
I want to remove this h6 tag from this and i still want to reduce the
text size. I am not sure as...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |