iHero Posted March 28, 2013 Author Share Posted March 28, 2013 The code that does this in CS:DE is very heavy, I simplified it.```Public Function MakeText(text As String, ChatWidth As Long) As String Dim n As Long Dim TextWidth As Long, MinText As String For n = 1 To Len(text) MinText = Mid$(text, n, 1) TextWidth = TextWidth + frmMain.TextWidth(MinText) If TextWidth > ChatWidth Then MakeText = MakeText & vbNewLine TextWidth = 0 Else MakeText = MakeText & MinText End If NextEnd Function```But there is one problem: when it will add a new line, he cuts a letter. I'm leaving, if someone can fix I appreciate it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now