@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: This function retrieves the number of characters in a specified string that fit within a specified space and fills an array with the text extent for each of those characters. A text extent is the distance between the beginning of the space and a character that fits in the space. !!!!C# Signature: [DllImport("coredll.dll")] public static extern bool GetTextExtentExPointW(IntPtr hDc, string lpString, int nLength, int nMaxExtent, int[] lpnFit, int[] alpDx, out Size size); !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: None. !!!!Tips & Tricks: Set lpnFit to null to ignore nMaxExtent. Setting lpnFit and alpDx to null will get you the functionality of GetTextExtentPoint. !!!!Sample Code: ... using(Graphics g = ctrl.CreateGraphics()) { IntPtr hDC = g.GetHdc(); string testString = "Hello p/Invoke"; int width = 30; int[] fi = new int[1]; int[] charExtents = new int[testString.Length]; Size sz; GetTextExtentExPointW(hDC, testString, testString.Length, width, fit, charExtents, out sz); ... g.ReleaseHdc(hDC); } ... Please add some! Documentation: GetTextExtentExPoint@msdn on MSDN
Edit coredll.GettextEx...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.