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. Design Time Events?

Design Time Events?

Scheduled Pinned Locked Moved C#
csharpvisual-studiodesigntutorialquestion
5 Posts 2 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.
  • C Offline
    C Offline
    cnich23
    wrote on last edited by
    #1

    I recently developed my first full custom control. It is a is a simple tab control that mimics VS.NET 2005 look and functions. What I am trying to accomplish next is adding design time support. I have read tutorials and articles on this, but I am try to figure out how to add certain events to the control once it is added to a form. For eaxmple I want the developer to be able to switch tabs in design time. What has to be done in order to accomplish this? Thanks in advance. CBN

    T 2 Replies Last reply
    0
    • C cnich23

      I recently developed my first full custom control. It is a is a simple tab control that mimics VS.NET 2005 look and functions. What I am trying to accomplish next is adding design time support. I have read tutorials and articles on this, but I am try to figure out how to add certain events to the control once it is added to a form. For eaxmple I want the developer to be able to switch tabs in design time. What has to be done in order to accomplish this? Thanks in advance. CBN

      T Offline
      T Offline
      Thomas Stockwell
      wrote on last edited by
      #2

      You would have to implement a Control Designer. ParentControlDesigner if I am correct. Here are basic steps: 1) Create an inherited class of a ParentControlDesigner, or the designer that is best suited for you. For the purpose of instruction the inherited Designer is called TabDesigner. 2) For the control (Tab Control in this case) you will add the Desinger attribute to the control class with reference to TabDesigner 3) In TabDesigner you will override the WndProc function so that you can get a handle on all events to the TabControl. You will add any code you will like to change tabs and handle click events by processing WM_MOUSEMOVE and WM_RBUTTONCLICK (may not be exact constant names, check with API-Viewer (google it)) 4) To add any VS menu items to your control during designer-time you will override the Verb collection property. In the initialization of the TabDesigner you will create a new Verb Collection and return the new verb collection in the Verb property 4) Test your control with the new designer during Design-Time I would go into more detail with this information and include information on VS smart tags, but that would take longer. If you have any questions just ask. Regards, 1tg46 P.S. This sounds like a good article that I could write, so check within the next month at this site and I may have posted an article on this subject. Check out 3D Game Development with Dark Basic Professional [^]programming.

      C 1 Reply Last reply
      0
      • T Thomas Stockwell

        You would have to implement a Control Designer. ParentControlDesigner if I am correct. Here are basic steps: 1) Create an inherited class of a ParentControlDesigner, or the designer that is best suited for you. For the purpose of instruction the inherited Designer is called TabDesigner. 2) For the control (Tab Control in this case) you will add the Desinger attribute to the control class with reference to TabDesigner 3) In TabDesigner you will override the WndProc function so that you can get a handle on all events to the TabControl. You will add any code you will like to change tabs and handle click events by processing WM_MOUSEMOVE and WM_RBUTTONCLICK (may not be exact constant names, check with API-Viewer (google it)) 4) To add any VS menu items to your control during designer-time you will override the Verb collection property. In the initialization of the TabDesigner you will create a new Verb Collection and return the new verb collection in the Verb property 4) Test your control with the new designer during Design-Time I would go into more detail with this information and include information on VS smart tags, but that would take longer. If you have any questions just ask. Regards, 1tg46 P.S. This sounds like a good article that I could write, so check within the next month at this site and I may have posted an article on this subject. Check out 3D Game Development with Dark Basic Professional [^]programming.

        C Offline
        C Offline
        cnich23
        wrote on last edited by
        #3

        Thanks for all your information ... I am playing with this I have not found any good example code ... I will be excitinly waiting for your article!

        T 1 Reply Last reply
        0
        • C cnich23

          Thanks for all your information ... I am playing with this I have not found any good example code ... I will be excitinly waiting for your article!

          T Offline
          T Offline
          Thomas Stockwell
          wrote on last edited by
          #4

          Now the only problem that I see in writing this type of article is: What type of control would be both useful and simple to create that could use these design time features? I would want a control that wasn't so significant that it would take away from the overall article about the design time features. Any Suggestions? Regards, 1tg46 Check out 3D Game Development with Dark Basic Professional [^]programming.

          1 Reply Last reply
          0
          • C cnich23

            I recently developed my first full custom control. It is a is a simple tab control that mimics VS.NET 2005 look and functions. What I am trying to accomplish next is adding design time support. I have read tutorials and articles on this, but I am try to figure out how to add certain events to the control once it is added to a form. For eaxmple I want the developer to be able to switch tabs in design time. What has to be done in order to accomplish this? Thanks in advance. CBN

            T Offline
            T Offline
            Thomas Stockwell
            wrote on last edited by
            #5

            Here is the article: http://www.codeproject.com/useritems/TheCodeProject_DesignTime.asp[^] Should be done editing the article withing thirty minutes. Regards, 1tg46 Check out 3D Game Development with Dark Basic Professional [^]programming.

            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