Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - nullreferenceexception- dockingpanel  help...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

nullreferenceexception- dockingpanel help...

 Post Reply Post Reply
Author
Message
Jack.Lau View Drop Down
Groupie
Groupie


Joined: 13 January 2010
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jack.Lau Quote  Post ReplyReply Direct Link To This Post Topic: nullreferenceexception- dockingpanel help...
    Posted: 11 February 2010 at 10:42pm
dear all:
      i meet an an err: System.NullReferenceException:Objec reference not set to an instance of an object when
show a child form with dockingpanel and commandbar control in a mdi form.
 
     step1: create a mdi form "MDIParent1" with menu item "new form"
     step2: create another form "Form1"
     step3: put a dockingpanel and commandbar  control in form1, put another two RichTextBoxs as panels
     step4: code in form1 is follows:
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim Control, CtlProject As XtremeCommandBars.CommandBarControl
        CtlProject = wndAxCommandBars.ActiveMenuBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlPopup, 100, "New", -1, False)
        With CtlProject.CommandBar.Controls
            Control = .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 200, "Exit")
            Control.BeginGroup = True
            Control = .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 300, "Login")
            Control.BeginGroup = True
        End With
        wndAxDockingPane.SetCommandBars(wndAxCommandBars.GetDispatch)
        wndAxDockingPane.Options.HideClient = True
        Dim panA, panB As XtremeDockingPane.Pane
        panA = wndAxDockingPane.CreatePane(1, 220, 1200, XtremeDockingPane.DockingDirection.DockLeftOf, Nothing) '
        panA.title = "This pane1"
        panB = wndAxDockingPane.CreatePane(2, 220, 1200, XtremeDockingPane.DockingDirection.DockBottomOf, panA) '
        panB.title = "This pane1"
    End Sub
    Private Sub wndAxDockingPane_AttachPaneEvent(ByVal sender As System.Object, ByVal e As AxXtremeDockingPane._DDockingPaneEvents_AttachPaneEvent) Handles wndAxDockingPane.AttachPaneEvent
        Select Case e.item.Id
            Case 1 : e.item.Handle = RichTextBox1.Handle.ToInt32
            Case 2 : e.item.Handle = RichTextBox2.Handle.ToInt32
        End Select
    End Sub
End Class
      step5: code in MDIParent1 is follows:
Imports System.Windows.Forms
Public Class MDIParent1
    Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewToolStripMenuItem.Click, NewToolStripButton.Click
        Dim ChildForm As New Form1
        ChildForm.MdiParent = Me
        Static Dim m_ChildFormNumber As Integer
        m_ChildFormNumber += 1
        ChildForm.Text = "Doc - " & m_ChildFormNumber
        ChildForm.Show()
    End Sub
End Class
      step5: when startwith form1, every thing runs well, includes the commandbar and dockingpanel control
      step6: when start with MDIParent1 , it shows the form1 as a child form, when use the commandbar and dockingpanel control,
error occurs:
  err1: with commandbar
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim Control, CtlProject As XtremeCommandBars.CommandBarControl
        CtlProject = wndAxCommandBars.ActiveMenuBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlPopup, 100, "New", -1, False)
----->System.NullReferenceException:Objec reference not set to an instance of an object
 
  err2: with dockingpanel
        Dim Control, CtlProject As XtremeCommandBars.CommandBarControl
        'CtlProject = wndAxCommandBars.ActiveMenuBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlPopup, 100, "New", -1, False)
        'With CtlProject.CommandBar.Controls
        '    Control = .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 200, "Exit")
        '    Control.BeginGroup = True
        '    Control = .Add(XtremeCommandBars.XTPControlType.xtpControlButton, 300, "Login")
        '    Control.BeginGroup = True
        'End With
        wndAxDockingPane.SetCommandBars(wndAxCommandBars.GetDispatch)
        wndAxDockingPane.Options.HideClient = True
        Dim panA, panB As XtremeDockingPane.Pane
        panA = wndAxDockingPane.CreatePane(1, 220, 1200, XtremeDockingPane.DockingDirection.DockLeftOf, Nothing) '
        panA.title = "This pane1"----->System.NullReferenceException:Objec reference not set to an instance of an object
-------------------------------------

Visual Studio 2005 8.0.50727.42

Visual Basic Project

.net framework 2.0.50727

Codejock13.2.1 ActiveX

Back to Top
nvierros View Drop Down
Groupie
Groupie
Avatar

Joined: 02 July 2006
Location: Australia
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote nvierros Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2010 at 5:59am
panA.title = "This pane1"----->System.NullReferenceException:Objec reference not set to an instance of an object

Hi,
I also have this error, is there a resolution?
Cheers

Back to Top
modwyer8 View Drop Down
Newbie
Newbie


Joined: 10 June 2009
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote modwyer8 Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2010 at 12:39pm
I am having the same problem.  It seems that I get the NullReferenceException error when I set the MDIParent of the form that contains the DockingPanes.  If I remove that line then the form launches fine.

Now the question is, can the docking panes NOT be used on a child form in an MDI app?
Product: Xtreme SuitePro ActiveX 2009 (13.0.0)
Platform: Windows XP (32bit) - SP 3
Language: C#, VS2005
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.