Cleaning up the content of an Anchor Bar

N

ng.johnny

Hi Everyone,

I am having some difficulty using the Anchor Bar Usage sample from the
Visio 2007 SDK. The problem I am having is that the content of the
Anchor Window doesn't display properly. I did some debugging and found
that the following line of code:

listForm.Dispose();

in this section of code:

// Set the form as contents of the anchor bar.
listForm = new AnchorBarForm();
listForm.ParentVisioApplication = visioApplication;
addFormToAnchorWindow(anchorWindow, listForm);
listForm.Dispose();

is causing the display problem. As I commented out the line that
dispose the form, everything works fine.
Then I run into another problem when I tried to close the Anchor
Window. It seems like by closing the Anchor Window, it doesn't close
the form that was added to it as a child. As the result, the form
shows up by itself after I closed the Anchor Window. Any idea how I
can close the form when I close the Anchor Window?

Thanks all.

Johnny
 
J

JuneTheSecond

Please try, Visible property as Visible=False, when you wish to close it.
 
N

ng.johnny

Please try, Visible property as Visible=False, when you wish to close it.

Thanks for the reply. I understand that I can keep the window open and
hide it but what if I want to update the content of the form. Since
the parent of the form is not set in the sample, how do I get the
handle of it? I was thinking setting the form's Mdiparent to the form
that is containing the Anchor Window but form is already a MdiChildren
so I can't do that...

thanks again.

Johnny
 
D

David Parker

The automatic refresh has always been a bit of a problem.
Notice that the AddFormToAnchorWindow function includes a "nudge" factor to
force the refresh.
Perhaps you need to do similar?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top