Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Fixing a TextBox Size within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, i'm using textboxes to mark some places on the map customizing the text. I use: Code: tbox = Shapes.AddTextbox(Location, ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| i'm using textboxes to mark some places on the map customizing the text. I use: Code: tbox = Shapes.AddTextbox(Location, 1, 1); Code: tBox.Width = getWidthByString(textToDisplay); Code: private int getWidthByString(string name)
{
int w = 0;
foreach (char c in name)
{
if (Char.IsLower(c)) { w += 11; }
if (Char.IsUpper(c)) { w += 12; }
}
return w;
}
Any Idea? Gianmaria Last edited by Gianmaria; 10-12-2007 at 05:34 AM.. Reason: fix |
| |||
| Re: Fixing a TextBox Size
Hi, The text is proportional font. A lot of characters are the same size, but for the smaller and larger ones you have to put a case statement in your width calculation routine. I think the most easy is to make a textbox with all characters in it. Then copy the map with textbox to clipboard, then paste it in your favourite picture editor and zoom it in and count the pixels for each character.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| fixing, size, textbox |
| ||||
| Posted By | For | Type | Date | |
| MapPoint Download - MP2K Magazine | This thread | Refback | 10-14-2007 02:16 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Arrow size | Anonymous | MapPoint 2006/2009 Discussion | 0 | 10-14-2004 02:43 PM |
| Polyline Size | Anonymous | MapPoint 2006/2009 Discussion | 4 | 09-29-2004 06:08 AM |
| Different image size | webjagger | MapPoint 2006/2009 Discussion | 0 | 06-24-2004 07:14 AM |
| Fixing Printing Problems in MP | Anonymous | MapPoint 2006/2009 Discussion | 2 | 03-17-2004 09:56 AM |
| size of a territory | Anonymous | MapPoint 2006/2009 Discussion | 0 | 11-04-2003 05:23 PM |
Madeira Holiday
Why not book a Madeira holiday through UlookUbook and enjoy this warm Portuguese island at a bargain price!