views:

110

answers:

2

Hi all,

I am currently working on a multi branch desktop based project using VB.NET 2008.

My Admin want to see the list of currently working branches and not working branches. Additionally they want to know how long a branch is not working.

To display the offline branches I first take a ListBox control named lstListBranch and then upon that control I take another ListBox control named lstListTime to display the offline time.

I want to permanently hide the scrollbar for lstListTime control and want to scroll lstListTime when lstListBranch is scrolled.

Can anyone help me in that purpose?

Thanks in advance.

A: 

There is an implementation of a custom list that has the ability for the scroll to be hidden here

Preet Sangha
This code is written in C#. But I want VB.NET Code. Thanks for the help.
Tareq
+1  A: 

Check my code in this thread for a trick to keep list boxes scrolling in-sync. Turning off the scrollbar requires overriding the CreateParams property:

Public Class MyListBox
  Inherits ListBox

  Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
    Get
      Dim parms As CreateParams = MyBase.CreateParams
      parms.Style = parms.Style And Not &H200000      ' turn off WS_VSCROLL
      Return parms
    End Get
  End Property
End Class
Hans Passant
Many many thanks for your kind help.
Tareq