Change the title of a NUIDocument causes resize/reposition


Author
Message
Craig Swearingen
Craig Swearingen
Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)
Group: Forum Members
Posts: 99, Visits: 654

I have a DocumentViewStyle application set to MdiStandard on the 11.12.14.12 build.  I need to be able to change the frame title of my documents after they've been created on certain possible user events.  Using the key I've been able to find the NUIDocument which needs changing and I can set the Text property of it to my new title.  When I do this the frame title does change to the new text but the document is moved to the position where it was first created and its size is set to what it was when it was first created.

I don't see another option.  How can I change just the title of the document frame alone?


Reply
Craig Swearingen
Craig Swearingen
Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)
Group: Forum Members
Posts: 99, Visits: 654

The code you provided is exactly what I am doing.  With this code I see the MdiChild size and position change along with the frame title.

I spent an hour or so downloading and trying to build with the latest Nevron UI for .Net build on the website.  I uninstalled the build I've been using and installed the new one.  I can get my code to build with it and it runs but I see the exact same symptoms using the latest build.  I doesn't work with this build either.  (I know I'm using the latest Nevron UI build now because I see the Evaluate popup now.)  I tried the following and this mostly works but has some issues still (like not affecting the top most frame title when the document is maximized):

if (doc.Host is NMdiChild)

{

NMdiChild child = doc.Host as NMdiChild;

child.Text = title;

}

Also, I also found another problem with little testing thus far on the latest build:  I register:

DockManager.DocumentManager.DocumentClosing += new DocumentCancelEventHandler(DocumentManager_DocumentClosing);

private void DocumentManager_DocumentClosing(object sender, DocumentCancelEventArgs e)

{

if (e.Document.Client == null)

return;

NForm frm = (NForm)e.Document.Client;

if (!frm.IsDisposed)

{

frm.Close();

if (!frm.IsDisposed)

{

e.Cancel = true;

}

}

}

I put NForms on my doc.Client.  The above cast to NForm will always work.  When doing this the frm.Close() above now causes a NullReferenceException in this designer code on my form on the base.Dispose() line:

protected override void Dispose(bool disposing)

{

if (disposing && (components != null))

{

components.Dispose();

}

base.Dispose(disposing);

}

This is a major regression as I rely on the frm.Close to know if it can't be closed at this time.  I don't believe I can move up to this build.  Any further advice on either issue?


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search