Shorten a Source File

Shorten a Sorce File

This makes a lable named labPicture shorten its file locations useing "...".

Private Sub labPicture_Change()
Dim Xstr As String
   labPicture.AutoSize = True
   If labPicture.Width >= 4050 Then
       Xstr = Right(labPicture.Caption, Len(labPicture.Caption) - 3)
       If Left(Xstr, 3) = "..." Then
           Xstr = Right(Xstr, Len(Xstr) - 4)
       End If
       Do Until Left(Xstr, 1) = ""
           Xstr = Right(Xstr, Len(Xstr) - 1)
       labPicture.Caption = Left(labPicture.Caption, 3) & "..." & Xstr
   End If
   ListView1.Picture = LoadPicture(labPicture.Tag)
End Sub

You might also like...


Nick Avery I am as a web developer for a small company, working for a small company. I work on banking websites and verious related projects.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.” - Donald Knuth