Print Page | Close Window

Commndbar nullreferenceexception

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23948
Printed Date: 29 April 2024 at 3:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Commndbar nullreferenceexception
Posted By: florentsegui
Subject: Commndbar nullreferenceexception
Date Posted: 28 January 2020 at 3:21pm
Hello,

I'm trying to use the commandbar control on a MDI Child in VB.NET.
I've got two commandbar controls:
- one on the MDI Container form
- one on the MDI Child form

On the parent, everything is OK. I can add commandbars, contextmenus...
On the child, I've a null reference exception as soon as I try to add something...

I'm using Codejock 19.1 and VS2017 (NET 4.7.2)

If I do this:
Dim test As TestForm
test = New TestForm()
test.MdiParent = Me
test.AxCommandBars1.ContextMenus.Add(500, "test")

I've a nullreferenceexception

If I do this:
Dim test As TestForm
test = New TestForm()
test.AxCommandBars1.ContextMenus.Add(500, "test")

All is OK
How can I use a commandbar on a MDI Child?  

Thanks



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net