I found that it would be really useful if I could get the pixel length of any string in DX that I want to display (I'm using 2D) so I can keep it withing bounds of a textbox for example. Does anybody know a way of doing this If not, does anybody know another way to achieve the scrolling in a textbox

Using Text
BenKC
Unfortunately this does not currently work since you also are required to pass in a rectangle to the Draw function at the same time but you can't pass in a rectangle size because you haven't calculated it yet...quite the vicious cycle and I'm hoping this will be (is maybe ) fixed in a future managed directX update.
Until then i know of two methods of calculating the length of your text, one is the one that I currently use but I just found out tonight that there is an error (that I've never noticed) in that extra pixels are thrown onto the end so I'm including a link to another solution that apparently addresses that issue (although I haven't tried it myself yet)
Method 1:
Public Function MeasureString(ByVal e As PaintEventArgs, ByVal stringToMeasure As String, ByVal font As System.Drawing.Font) As SizeF
Return e.Graphics.MeasureString(stringToMeasure, font)
End Function
So basically that function will return you the rectangle dimensions of your string (height and width)
but like I mentioned apparently it's about an em to long so this other guy has created a new method which you can read about here
New MeasureString method
But eventually you should be able to bypass using both of these methods and we can all begin using the much desired
DrawTextFormat.CalculateRect
(also anyone please feel free to correct me if I'm passing incorrect information along here, I'm trying my best to be helpful, but I'm new to a lot of this myself)
[Edit: I tried to fix whatever funky stuff is going on with the text oddly sizing here (they were VERY small) but I gave up after a bit, but it is larger now at least (and readable)]
reno_rens2002
(I'm assuming means it won't show up in any form in DX10 - maybe someone from DX can confirm this)
boran_blok
Ya I guess I'll try to switch to the DX 9 and .NET
Pete US
Is this from DX9 I'm using DX7 for 2D and DX8 for netoworking and VB 6 can't find PaintEventArgs. If it's not, does this require me to include another Reference or something If it is, do you know how to do this in earlier versions of DX
Leonard French
Considering DX9 has been out for 2 years now and we are starting to talk about DX10 you are going to find it tough to find people with DX7/8 knowledge....