Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#8805 from N-thony/multiple_rece…
Browse files Browse the repository at this point in the history
…iver_scrolling

Disabled horizontal scrollbar in multiple receiver
  • Loading branch information
conlooptechnologies authored Feb 13, 2024
2 parents df7d685 + d9acd43 commit 8446b68
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions instat/ucrReceiverMultiple.vb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Public Class ucrReceiverMultiple
If bFirstLoad Then
If lstSelectedVariables.Columns.Count = 0 Then
lstSelectedVariables.Columns.Add("Selected Data")
lstSelectedVariables.Columns(0).Width = lstSelectedVariables.Width - 25
End If
'by default multiple receivers will not be autoswitched on selection change
bAutoSwitchFromReceiver = False
Expand Down Expand Up @@ -168,12 +167,21 @@ Public Class ucrReceiverMultiple
'it's not clear when the receiver will ever have more than one data frame

'reset the header text with the name
lstSelectedVariables.Groups(0).Header = lstSelectedVariables.Groups(0).Name
lstSelectedVariables.Groups(0).Header = ShortenString(lstSelectedVariables.Groups(0).Name)
If lstSelectedVariables.Groups.Count = 1 AndAlso lstSelectedVariables.Items.Count > 0 Then
lstSelectedVariables.Groups(0).Header = lstSelectedVariables.Groups(0).Header & " (" & lstSelectedVariables.Items.Count & ")"
End If
End Sub

Private Function ShortenString(strText As String) As String
Dim maxLength As Integer = 10
If strText.Length > maxLength Then
' Trim the string to the specified length and add ellipsis
Return strText.Substring(0, maxLength) & "..."
End If
Return strText
End Function

Public Overrides Function IsEmpty() As Boolean
Return lstSelectedVariables.Items.Count = 0
End Function
Expand Down Expand Up @@ -502,6 +510,12 @@ Public Class ucrReceiverMultiple
CheckSingleType()
End Sub

Private Sub lstSelectedVariables_ClientSizeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lstSelectedVariables.ClientSizeChanged
If lstSelectedVariables.Columns.Count > 0 Then
lstSelectedVariables.Columns(0).Width = lstSelectedVariables.ClientSize.Width
End If
End Sub

Private Sub ucrReceiverMultiple_SelectionChanged(sender As Object, e As EventArgs) Handles Me.SelectionChanged
CheckSingleType()
End Sub
Expand Down

0 comments on commit 8446b68

Please sign in to comment.