Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows
Visual Basic > ActiveX Controls sample source codes
Word Wrap
Word Wrap Function WWrap(StrDummy As String, StrSize As Integer) As String ' If Len(Trim(StrDummy)) < StrSize Then WWrap = StrDummy Exit Function End If ' Dim StrLine1 As String Dim LoopI As Integer Dim IntJ As Integer LoopI = 1 StrLine1 = Mid(StrDummy, LoopI, StrSize) WWrap = "" While Trim(StrLine1) <> "" If (Mid(StrDummy, (LoopI - 1) * Len(StrLine1) + 1, 1) <> " ") Then IntJ = InStrRev(StrLine1, " ") If IntJ <> 0 Then StrDummy = Mid(StrDummy, 1, (LoopI - 1) * StrSize + IntJ - 1) + String(StrSize - IntJ + 1, " ") + Mid(StrDummy, (LoopI - 1) * StrSize + IntJ + 1) End If End If LoopI = LoopI + 1 StrLine1 = Padr(Mid(StrDummy, (LoopI - 1) * StrSize + 1, StrSize), StrSize) Wend WWrap = StrDummy End Function
Privacy Policy
|
Link to Us
|
Links