Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

ToolStripManager.LoadSettings - unexpected ArgumentNULLException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Zenkel - 26 Jun 2006 10:24 GMT
ToolStripManager.LoadSettings - unexpected exception ArgumentNULLException

USING:
Visual Studio 2005, .net-Framework 2.0, C# (same effect with VB)

PROBLEM:
ToolStripManager.LoadSettings(this) throws an ArgumentNULLException
exception. Input parameter 'this' is a valid Windows.Form, not NULL.

DETAILS:
'this' is a MDI container form. It has one ToolStripPanel with one
ToolStrip. This ToolStrip has one ToolStripButton.
One MDI child form is open inside the container form. The child form has its
own ToolStripPanel with one ToolStrip with one ToolStripButton.
At runtime the user moves the child form ToolStrip form the child form
ToolStripPanel into the parent form ToolStripPanel.
After that the application calls ToolStripManager.SaveSettings and after
that ToolStripManager.LoadSettings. This call throws an ArgumentNULLException.

QUESTIONS:
1) Am I doing something wrong?
If this is a bug:
2) When will it be fixed?
3) Is there any workaround?

(The possibility of saving/loading layout was one main reason for our
decision on using the new MS menu calsses instead of third-party components.)

STEPS TO REPRODUCE:
(Designer used, as far as possible)
- new C# Windows Application
- set IsMdiContainer to true for Form1
- add ToolStripPanel to the Toolbox (if not yet done)
- add ToolStripPanel to Form1
- add ToolStrip to the ToolStripPanel in Form1
- generate new ToolStripButton on this ToolStrip
- doubleclick on this new button and implement the event handler:
    private void toolStripButton1_Click(object sender, EventArgs e)
    {
        ToolStripManager.SaveSettings(this);
        ToolStripManager.LoadSettings(this);
    }
- switch back to designer, doubleclick on Form1 and implement form load
event handler
    private void Form1_Load(object sender, EventArgs e)
    {
        Form2 f = new Form2();
        f.MdiParent = this;
        f.Show();
    }
- add a new windows form to the project (Form2)
- add ToolStripPanel to Form2
- add ToolStrip to the ToolStripPanel in Form2
- generate new ToolStripButton on this ToolStrip
- start the application
- move the child ToolStrip into the parent form ToolStripPanel (using mouse
and menu grip)
- click the button of the parent form ToolStrip
- ArgumentNULLException

Suggestion/hints/solutions highly appreciated.
Thanks for reading this.
Peter Ritchie - 26 Jun 2006 19:28 GMT
I'd say you've found a bug.  I suggest logging it at Visual Studio and .NET
Framework Feedback
(http://connect.microsoft.com/feedback/default.aspx?SiteID=210)
Signature

http://www.peterRitchie.com/

> ToolStripManager.LoadSettings - unexpected exception ArgumentNULLException
>
[quoted text clipped - 58 lines]
> Suggestion/hints/solutions highly appreciated.
> Thanks for reading this.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.