problem with edting controls in form design view

Docking/MDI for Windows Forms Forum

Posted 14 years ago by sijin lin
Avatar
In UIStudio c# sample program , I often get reference null exception that prevent me from editing controls.
Here are error messages appeared in tabtrip sample form in c# TabStrip example, the other two forms have the similar problem.

System.NullReferenceException: Object reference not set to an instance of an object at OnSetCursor() at System.Windows.Forms.Design.ControlDesigner.WndProc(Message& m) at System.Windows.Forms.Design.ParentControlDesigner.WndProc(Message& m) at Sysetm .....

Comments (11)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Which build do you have? We had another user report getting that exception but it stopped when they got build 26. Also, we were never able to duplicate it on any of our systems.

Can you also tell me which operating system and .NET framework / VS you use?


Actipro Software Support

Posted 14 years ago by sijin lin
Avatar
am using build 26 with window XP and Visual studio .Net 2003.

Here is how to reproduce the problem:
1. open tabStripForm.cs in Design mode
2. move cursor on or click on one of controls in right side (Renderer, Event or the property).
3. An error message box will pop up right way
"Object reference not set to an instance of an object"

,and the control which the mouse points to is replace by a red text box with exception text inside.

Thank for quick response.

-Sijin Lin
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I tried on my XP box with VS 2003 and it works fine. I clicked all over the controls. I had another customer try and he didn't have any issue either.

So since we can't dupe it here, you might have to help us narrow it down. Can you start by creating a blank form with one of the NavigationBarPanel controls on it and then save it, close, reopen, and see if you get the exception? Then start adding controls, and with each control, save, close the designer, and reopen to see what causes it to break.

The end goal is to narrow down what is causing this since the exception is completely in Microsoft's designer code.


Actipro Software Support

Posted 14 years ago by sijin lin
Avatar
I found the problem is caused when using navigation Bar and Dock Manager together. I couldn't use navigation bar and navigation pane with dock manger at all. Here are two test cases:

Test case 1:
(1). Create a windows form c# project
(2). Add a Navigation Bar
(3). Add couples of navigation panes to this Navigation Bar. It works fine up to this point.
(4). Add a Dock Manager, and then try to add one more Navigation Pane to the above navigation bar, an error dialog shows "Only one instance of an 'ActiprooSoftware.UIStudio.NavigationBar.NavigationPane' component is permit in host designer". This doesn’t make sense to me because if a Navigation bar cannot contain more that one pages (panes) why do we need navigation bar. The reason I add a dock manger is because I want to dock the Navigation bar with other tool windows later. The navigation bar test form in your sample program seems not containing a dock manager, so this might explain why you couldn't reproduce the error as I have seen.

Test case 2:
(1). Create a windows form project in C#
(2). Add a dock manager.
(3). Add a navigation bar.
(4) Add couples of navigation panes to the navigation bar. So far so good.
(5) Dock the navigation bar from pop up context menu; I can do this because I add a dock manager.
(5) Save this From1 [Design] and close it.
(6) Reopen Form1 [Design], an error dialog shows "Object reference not set to an instance of object" and then navigation bar turn to be a red framed box with exceptions displayed inside.


My project is tucked on this problem, please provide a solution so that I can use your navigation controls.

Thanks!

-Sijin Lin
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks, I was able to get an error in the designer. It seems to possibly be something with our obfuscator that is breaking things. I'll assemble a test build for you and will e-mail you in the next day or so.


Actipro Software Support

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks so much for e-mailing and working with us to solve the issue. It did end up being something that our obfuscator broke. A maintenance release with the fix will be available in the next several days.


Actipro Software Support

Posted 14 years ago by Wyatt Albiston - Software Engineer, Bill Good Marketing
Avatar
I'm getting the same problem in UIStudio 1.0.0028
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That should have been fixed in build 27. Can you tell us how to reproduce it?


Actipro Software Support

Posted 14 years ago by Wyatt Albiston - Software Engineer, Bill Good Marketing
Avatar
To recreate it try this:

1 - create a dockmanager

2 - create 4 panels, name them:
pnlDay
pnlWeek
pnlMonth
pnlYear

select all 4 at once, then right click one of them and choose dock control. Then, select each resulting tab one at a time and remove the "pnl" from the text property (i.e. pnlDay would change to Day) and change the name property to be toolWindow + the text property (i.e. toolWindowDay, etc).

When I run this I get the error.
Posted 14 years ago by Wyatt Albiston - Software Engineer, Bill Good Marketing
Avatar
The suspend/resumelayout thing apparantly caused this issue as well. It is not exhibiting this behavoir with those statements commented out.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I followed your steps but didn't get any errors.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.