Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. visual studio designer

visual studio designer

Scheduled Pinned Locked Moved C#
questioncsharpdatabasevisual-studiosysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mdolby
    wrote on last edited by
    #1

    Hi, I've been trying to get the designer in visual studio to work for a class which isn't derived from "form".. It is a class derived directly from System.. I want the designer to work for my class so I can to drag the database connection from the "server explorer". And have it add all the code automatically to my class as is done for classes derived from "form".. How can I do this?? Your help as always would be greatly appreciated!!

    J 1 Reply Last reply
    0
    • M mdolby

      Hi, I've been trying to get the designer in visual studio to work for a class which isn't derived from "form".. It is a class derived directly from System.. I want the designer to work for my class so I can to drag the database connection from the "server explorer". And have it add all the code automatically to my class as is done for classes derived from "form".. How can I do this?? Your help as always would be greatly appreciated!!

      J Offline
      J Offline
      John Fisher
      wrote on last edited by
      #2

      There was a quick "tip" about just this in one of the recent MSDNTV items. (Go to www.msdn.com/msdntv[^], then look at the archive for the one by Juval Lowy.) Anyway, you temporarily inherit your class from Control (I think), which then enables the designer to do the database work for you. Then you remove the control inheritance if needed. John John
      "We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words

      K 1 Reply Last reply
      0
      • J John Fisher

        There was a quick "tip" about just this in one of the recent MSDNTV items. (Go to www.msdn.com/msdntv[^], then look at the archive for the one by Juval Lowy.) Anyway, you temporarily inherit your class from Control (I think), which then enables the designer to do the database work for you. Then you remove the control inheritance if needed. John John
        "We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words

        K Offline
        K Offline
        Kastro
        wrote on last edited by
        #3

        I'm doing something similar right now actually... Working on creating a GUI library and engine using DirectX that is designable. You have to implement IComponent in your class (deriving from Component is a quick way to do this) because the DesignerHost (service provided and used by VS.NET) utilizes sites (ISite), which are the basis of components. Then you have to specify an IRootDesigner-implementing class in a DesignerAttribute for you IComponent class. You can try using ComponentDocumentDesigner for that if you don't need any custom designer stuff. Also check out an article/sample named ShapeLibrary that gives a nice easy example of utilizing design-time services in .NET. You can find it here: http://windowsforms.net/articles/shapedesigner.aspx[^] Hope this helps...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups