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 / Visual Studio.NET / IDE / July 2008

Tip: Looking for answers? Try searching our database.

visual studio macro: How to stop closing document on DocumentEvents.DocumentClosing?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Layman - 16 Jul 2008 15:56 GMT
Hi there,

I'm writting a macro in Visual Studio 2008.
I want to check document when I click close on a file in Visual Studio
Editor, and keep the document opening if I find something.
I add check code in DocumentEvents.DocumentClosing, but I don't know how
to prevent the document closing. Could anyone give me some suggestion?

Thanks a lot.
Layman
Jeff Johnson - 17 Jul 2008 23:34 GMT
> I'm writting a macro in Visual Studio 2008.
> I want to check document when I click close on a file in Visual Studio
> Editor, and keep the document opening if I find something.
> I add check code in DocumentEvents.DocumentClosing, but I don't know how
> to prevent the document closing. Could anyone give me some suggestion?

Since the event handler only get a reference to the Document and not an
EventArgs object that has a Cancel property or something similar, I'd be
willing to say that there is no way to prevent the document from being
closed.

Then there's this little tidbit in the help for the DocumentClosing event:

This API supports the .NET Framework infrastructure and is not intended to
be used directly from your code.

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.