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 / Extensibility / October 2005

Tip: Looking for answers? Try searching our database.

How to get IDesignerHost from VS 2003 Add-In

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Song - 27 Oct 2005 01:26 GMT
I tried with the following C# code:

Window winObject = applicationObject.ActiveDocument.ActiveWindow;
Object activeObject = winObject.Object;
IDesignerHost designerHost = (IDesignerHost)activeObject;
if ( designerHost == null )
   return;

But it does not work. The variable designerHost is always null. Anything
wrong?

I read the following article:
HOWTO: Getting IDesignerHost and IHTMLDocument of WebForms from a Visual
Studio .NET add-in
http://support.microsoft.com/default.aspx?scid=kb;en-us;555327

It said that VSIP SDK 2003 Extras is needed to get IDesignerHost interface
of a Web form.

My question is:
Does this apply to Window form too? I have only MSDN professional
subscrption. Does it include VSIP SDK?
Carlos J. Quintero [VB MVP] - 27 Oct 2005 09:33 GMT
Hi Song,

I wrote the article, the article is right and your code seems to be fine.
You don´t need the VSIP SDK (which, by the way, is downloadable for
everybody, not just MSDN subscribers) to get the IDesignerHost of a Windows
Forms designer, only for Web forms. Also, form designers for Smart Device
forms always return a null IDesignerHost.

So, the question is: which kind of window is active when you invoke the
feature of the add-in? Is winObject.Object null for that window? If that
property is null, you will not be able to get a IDesignerHost, by any means
(VSIP Extras or not), from it....

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

>I tried with the following C# code:
>
[quoted text clipped - 18 lines]
> Does this apply to Window form too? I have only MSDN professional
> subscrption. Does it include VSIP SDK?
Song - 27 Oct 2005 18:58 GMT
Carlos,
Thanks. I see what the problem is now. I am using the designer for smart
device. Is there a way to get IDesignerHost from the designer for smart
device now?

> Hi Song,
>
[quoted text clipped - 31 lines]
> > Does this apply to Window form too? I have only MSDN professional
> > subscrption. Does it include VSIP SDK?
Carlos J. Quintero [VB MVP] - 28 Oct 2005 09:13 GMT
AFAIK, no using VS.NET 2003, I don´t know why. Maybe it is a bug or maybe MS
could not make it work until VS 2005.
Signature


Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

> Carlos,
> Thanks. I see what the problem is now. I am using the designer for smart
> device. Is there a way to get IDesignerHost from the designer for smart
> device now?

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.