开发者

ListBox Control in VB.NET 2008

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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜