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 / Design Time / January 2005

Tip: Looking for answers? Try searching our database.

IDE-integrated editor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith Rome - 22 Jan 2005 20:03 GMT
I would like to provide a design-time editor for a proprietary file format
within VS.NET. I am shooting for an experience not unlike the SQL Reporting
Services designer (although MUCH less complex).

I can just make a standalone editor utility, but it would be ideal if my
editor could be invoked directly within VS, from the project item that it is
related to (the edited file will always be an embedded resource file).

I would be perfectly happy to just have a default menu option associated
with files of a specific extension in the Solution Explorer, which when
activated would launch a modal dialog where I could edit the contents of my
file.

I have done a lot of poking around in the design namespaces, and the only
thing that seems related to what I want to do is IRootDesigner, which just
sets up a design surface. I cannot find anything that explains where to go
after that, or even how to associate the IRootDesigner with my project
item(s).

Any hints or pointers?

Signature

Keith Rome
MCSD, MCAD, MCDBA

micha@nospam.com - 31 Jan 2005 22:18 GMT
Hey Ho Keith Rome

here is a very basic Sample how to do something like this.
GetView(ViewTechnology.WindowsForms) is the magic Word in the Code.

The rest works like any other Designer.

First Create a Component:

<Designer(GetType(SqlFormRootDesigner), GetType(IRootDesigner))> _
Public Class SqlForm
   Inherits Component

End Class

The Create a UserControl. The User Controls is later shown if you open the
File

Public Class SqlFormView
   Inherits System.Windows.Forms.UserControl

#Region " Windows Form Designer generated code "

bla bla

End Class

'Then Create the Root Designer for the Component

Public Class SqlFormRootDesigner
   Inherits System.Windows.Forms.Design.ComponentDocumentDesigner

   Private mComponent As SqlForm
   Private mComponentView As SqlFormView
   Private mHost As IDesignerHost

   Public Overrides Sub Initialize(ByVal component As
System.ComponentModel.IComponent)

       MyBase.Initialize(component)
       mComponent = component
       mComponentView = New SqlFormView
       mHost = Me.GetService(GetType(IDesignerHost))
       AddHandler mHost.LoadComplete, AddressOf HostLoadComplete

   End Sub

   Private Sub HostLoadComplete(ByVal sender As Object, ByVal e As
EventArgs)

       Dim designContainer As Windows.Forms.Control
       Dim rootDes As IRootDesigner

       rootDes = Me
       designContainer = rootDes.GetView(ViewTechnology.WindowsForms)
       mComponentView.Dock = DockStyle.Top
       designContainer.Parent.Controls.Add(mComponentView)

   End Sub

End Class

Now you can Inherit a Class from "SqlForm"
and the GUI of the UserControl will be shown.

> I would like to provide a design-time editor for a proprietary file format
> within VS.NET. I am shooting for an experience not unlike the SQL Reporting
[quoted text clipped - 16 lines]
>
> Any hints or pointers?

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.