VB 2005 Express Third Party Control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Baz

    #1

    VB 2005 Express Third Party Control

    Hi,

    I am new to VB .net (long time VBA programmer) and was trying to
    integrate a freeware list bar control into a windows mdi child form in
    VB.net 2005 Express. I think I am doing it right, obviously I'm not
    though!...

    Details of the control itself and links to the dll's required are on;
    =http://www.vbaccelerator.com/home/NE...tBar/VSNet_Sty...

    So, in the project I have referenced the two dlls mentioned and have
    plonked the VSNetListBar control into an otherwise empty form.

    I have added the following sample script (converted to VB from CS
    minus the random number bit).

    *************** *************** *************** *************** *************** *************** ***********
    Imports vbAccelerator.C omponents.ListB arControl
    Imports System.Windows. Forms

    Public Class frmChild

    Private Sub VsNetListBar1_L oad(ByVal sender As System.Object,
    ByVal e As System.EventArg s) Handles VsNetListBar1.L oad

    ' Create 4 bars and add a random number of items to each:
    Dim i As Integer = 0
    Do While (i < 4)
    ' Create the items:
    Dim jMax As Integer = (5)
    Dim subItems(jMax - 1) As VSNetListBarIte m
    Dim j As Integer = 0
    Do While (j < jMax)
    subItems(j) = New VSNetListBarIte m(String.Format ("Test
    Item {0} in Bar {1}", (j + 1), (i + 1)), (j Mod 4),
    String.Format(" Tooltip text for test item {0}", (j + 1)))
    If (j = 2) Then
    subItems(j).Ena bled = False
    End If
    j = (j + 1)
    Loop
    ' Create the group and add the sub items:
    Me.VsNetListBar 1.Groups.Add(Ne w
    VSNetListBarGro up(String.Forma t("Test {0}", (i + 1)), subItems))
    i = (i + 1)
    Loop
    End Sub

    End Class
    *************** *************** *************** *************** *************** *************** ************

    But a get the following exception detail.

    *************** *************** *************** *************** *************** *************** ************
    System.NullRefe renceException was unhandled
    Message="Object reference not set to an instance of an object."
    Source="acclVSN etListBar"
    StackTrace:
    at
    vbAccelerator.C omponents.ListB arControl.VSNet ListBarItem.Dra wButton(Graphic s
    gfx, ImageList ils, Font defaultFont, ListBarDrawStyl e style,
    ListBarGroupVie w view, Int32 scrollOffset, Boolean controlEnabled,
    Boolean skipDrawText)
    at
    vbAccelerator.C omponents.ListB arControl.ListB arItemCollectio n.Draw(Graphics
    gfx, Rectangle bounds, ImageList ils, Font defaultFont,
    ListBarDrawStyl e style, ListBarGroupVie w view, Boolean enabled, Int32
    scrollOffset)
    at
    vbAccelerator.C omponents.ListB arControl.VSNet ListBarGroup.Dr awBar(Graphics
    gfx, Rectangle bounds, ImageList ils, Font defaultFont,
    ListBarDrawStyl e style, Boolean controlEnabled)
    at
    vbAccelerator.C omponents.ListB arControl.ListB ar.Render(Paint EventArgs
    pe)
    at
    vbAccelerator.C omponents.ListB arControl.ListB ar.OnPaint(Pain tEventArgs
    e)
    at
    System.Windows. Forms.Control.P aintWithErrorHa ndling(PaintEve ntArgs e,
    Int16 layer, Boolean disposeEventArg s)
    at System.Windows. Forms.Control.W mPaint(Message& m)
    at System.Windows. Forms.Control.W ndProc(Message& m)
    at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
    at System.Windows. Forms.Container Control.WndProc (Message& m)
    at System.Windows. Forms.UserContr ol.WndProc(Mess age& m)
    at
    System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
    at
    System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
    at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr
    hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at
    System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)
    at
    System.Windows. Forms.Applicati on.ComponentMan ager.System.Win dows.Forms.Unsa feNativeMethods .IMsoComponentM anager.FPushMes sageLoop(Int32
    dwComponentID, Int32 reason, Int32 pvLoopData)
    at
    System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo pInner(Int32
    reason, ApplicationCont ext context)
    at
    System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo p(Int32
    reason, ApplicationCont ext context)
    at System.Windows. Forms.Applicati on.Run(Applicat ionContext
    context)
    at
    Microsoft.Visua lBasic.Applicat ionServices.Win dowsFormsApplic ationBase.OnRun ()
    at
    Microsoft.Visua lBasic.Applicat ionServices.Win dowsFormsApplic ationBase.DoApp licationModel()
    at
    Microsoft.Visua lBasic.Applicat ionServices.Win dowsFormsApplic ationBase.Run(S tring[]
    commandLine)
    at DAC.My.MyApplic ation.Main(Stri ng[] Args) in 17d14f5c-
    a337-4978-8281-53493378c1071.v b:line 81
    at System.AppDomai n.nExecuteAssem bly(Assembly assembly,
    String[] args)
    at System.AppDomai n.ExecuteAssemb ly(String assemblyFile,
    Evidence assemblySecurit y, String[] args)
    at
    Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()
    at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object
    state)
    at System.Threadin g.ExecutionCont ext.Run(Executi onContext
    executionContex t, ContextCallback callback, Object state)
    at System.Threadin g.ThreadHelper. ThreadStart()
    *************** *************** *************** *************** *************** *************** ************

    Any help greatly received!

    Thanks,

    Baz
Working...