Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21846

[RESOLVED] How to anchor a Label to a ListView?

$
0
0
Hello everyone,

I have a form with a Label called "StatusBar" located under a ListView called "Mismatch". We can see in the following 3-image imgur album that as the form is resized, the label is overlapped by the listview control:

http://imgur.com/6Z9rNBw,cuSHnml,18QJwx8#0

What I'd like to happen is for the label to move with the ListView, so that the label is always visible.

There is currently the following form code that happens when the form is resized:

Code:

[Private formEx As New FormExtension]

Private Sub Form_Resize()
  formEx.ReSize
End Sub

[Private mForm As Form
Private mTop As Long
Private mLeft As Long
Private mList As ListView
Private AdjustWidth As Long
Private AdjustHeight As Long]

Public Sub ReSize()
  If Not mList Is Nothing Then
      AdjustListSize mList, mForm, AdjustHeight, AdjustWidth
  End If
End Sub

Private Sub AdjustListSize(List As ListView, frm As Form, _
                              adjusth As Long, adjustw As Long)

  If frm.WindowState <> vbMinimized And adjustw <> -1 Then
      If (frm.width - adjustw) >= 1000 Then
        List.width = frm.width - adjustw - List.Left
      End If
     
      If (frm.Height - adjusth) >= 1000 And adjusth <> -1 Then
        List.Height = frm.Height - adjusth - List.Top
      End If
  End If
End Sub

What can be added to essentially "anchor" the label to the bottom of the listview?

Viewing all articles
Browse latest Browse all 21846

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>