December 14, 2004 19:46:07
Welcome to the place where the vibrant creation control is welcome.
1. Unlike other programmable objects, controls are two behaviors when designing and runtime. That is, the developer puts some of the code in the control when designing a control instance in the form, will execute. 2. The binary information such as bitmaps, such as bitmaps, will be saved in the same name's binaries, the extension of the file is .ctX. 3. In order to debug the behavior of the control design, the code in the control must be enabled when the test form placed in the design mode is held in the design mode. 4. Do not click the "Start" button on the toolbar or press the F5 key, because the entire engineering group will enter the running mode so that the new control cannot be added to the form. 5. Opening a control The designer makes all instances of the control into non-active. Change the code of the control code window also makes the control instance into non-active. 6. The key events in the UserControl Survival period are initialize, initproperties, readproperties, WriteProperties, and Terminate. 7. For UserControl objects, the LOAD and UNLOAD events are replaced by Readproperties and WriteProperties events. 8. After putting the control into the form, it is considered a permanent facility of this form. From the perspective of the author's vision, the control is always revoked and rebuilt. 9. After the control instance is created, you can get the property value saved by the control from the form that contains this control instance through the ReadProperties event. 10. Running control instances never get WriteProperties events because it does not need to save its property values. This is mainly due to the future consideration of Shapelabel. When it is compiled into a .oCX file, it will be added to another project, put an instance into the form, compile this project into a .exe file and run it. When the .exe file is turned off, the ShapeLabel instance can save the only place of its property value is the .exe file. The operating system that is working properly cannot allow such behavior. 11. When designing the user control, remember to work within the area of the SCALEWIDTH and SCALEHEIGHT constraints of the control. Anything other than this area is invisible to the user. In addition, the size of the customer area will change as the user's ideas. So the Resize event is one of the most important events in the control design. 12. Similar to adding attribute names and methods in class modules, you can add properties and methods to the Active control by creating a common process. 13. This introduces a repetitive topic of a control: the container can determine most of the behavior and appearance of the control. The container determines the NAME of the control, and the TOP and LEFT attributes that keep the relative container coordinate relationship. "14. Some simple properties created using the properties will be automatically displayed in the properties window of Visual Basic. You can also connect the controls and property pages, the property page displays the various properties of the controls in another format. 15. Properties The binary information such as the inert bitmap in the page is saved in the same binary, the file extension is .pgx.16. Whenever the property page receives a SelectionChanged event. Select the control list change Receive this event.
This is a must, because the Properties Page dialog is a non-Mode dialog, and the user may choose some other controls when the dialog opens. 17. It is determined whether an event occurs in a particular location called actions detection. Perhaps you will want to put the sniper detection code during the SHPBACK_CLICK event, because SHPBACK always changes the size to overwrite the entire surface of the Shapelabel control. However, the Shape control does not receive the Click event. This example is a UserControl object by receiving a Click event by an object containing the Shape object. 18. To switch the reuse project instead of the binary component status, click Add Project on the File menu and add the ControlDemo project to the backbound engineering group. The steps that should generally follow when creating a new control:
Determine the function that the control will provide. Design control of the appearance. Design control interface, the upcoming properties, methods, and controls. Create an engineering group consisting of control engineering and test engineering. Implement the appearance of the control by adding controls and or code to the UserControl object. Implement the interface and function of the control. When you add each interface element or function, you must add some functions to the test engineering to test the new features added. Design and implement the properties page for the control. Compile control components (.ocx files) and test it with a variety of possible applications.
If the controls provided by the control components are more than one, they should include those controls to work from the determination package. For separate controls, the test project should have a corresponding test form, and at least one form is placed together in a form.