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