Custom Controls: Property shadowing, etc.

Source: Internet
Author: User
attribute hiding can be divided into three kinds of situations:

1. Some properties that are added by the designer, such as locked, must be custom designed to filter out

2. Use override to set its visibility to false for properties that can be overridden

3. With new, set its visibility to false for properties that cannot be overridden

4. Alternatively, you can define the Hashtable variable to hide the attribute and use the custom function to handle the

Related information

1 C # Custom controls from getting started to mastering http://wenku.baidu.com/view/3f001cec102de2bd96058830.html

2) http://topic.csdn.net/u/20090328/13/f2da0338-3189-4f96-b631-43cea707ee1e.html custom Control

Related information

1 C # Custom controls: http://archive.cnblogs.com/a/1986737/

2) Graphic version: Http://wenku.baidu.com/view/a74c06b81a37f111f1855b24.html April 24, 2011 1. Adding controls to panels

Take Designerhosting (JXF) as an example:

1 Add Project in solution ' Shell, such as button

2 Add user control to project, type the name

3 After designing the button, add it to the panel.

4 Add a reference to the button inside the Toolbox

5) ToolboxXmlManager.cs Add the appropriate code to join the panel

Private type[]imagetooltypes = new type[]{

typeof (Gauge.mygauge),

typeof (Label.mylabel),

typeof (BUTTON.MYBTN),//The statement adds the Mybtn button among the buttons

}

6 Add a button reference in the shell

Taking Smartcontrol as an example

1) Add UserControl in Viguagelibrary

2 because to inherit commonlibrary inside the Iguagecontrol, so to add the appropriate reference in this project

3 in Videsigner ToolboxXmlManager.cs Modify the code to add the control to the panel April 25, 2011 1. Hide of Locked property

The Locked property is a property that is brought by the designer to add system.design references in project to remove

The following code can be implemented

#region Remove locked attributes from the designer

public class CustomDigitalDesigner:System.Windows.Forms.Design.ControlDesigner

{

Protectedoverride voidpostfilterproperties (System.Collections.IDictionaryproperties)

{

Properties. Remove ("Locked");

Base. PostFilterProperties (properties);

}

}

[Designer (typeof (Customdigitaldesigner))]

#endregion April 27, 2011

The next task:

1. Add all Windows form\groupbox Label

2. Add dx.10.2:data\gaugecontrol\ Circularfull-circularhalf-circularquarter-circularthreefourth-linearhorizontal-linearvertical-circularwide

3. Change the control's icon

Http://blog.sina.com.cn/s/blog_6fd674050100ptyw.html

Remember to add the associated reference using System.Drawing

Note that some properties of icon icons to be modified, the following figure, the properties of the Circle box will be modified to embeded resource.
April 28, 2011

Key words:

Ø Custom Controls Add events

1. Add Events for custom controls

To add a centralized method of events to a custom control

Http://www.cnblogs.com/jyk/archive/2008/07/03/1235029.html

2. The evaluation was written in detail

Http://blog.csdn.net/zhzuo/archive/2004/11/30/199599.aspx

And the solution in the forum is different:

Difference

Most of the solution is to use the custom space in the form of the project creation, and our requirement is to use it on the panel of the result of our program running. April 29, 2011

Some controls that need to be added in the control library

Button, CheckBox, RadioButton, TextBox, CheckedListBox, HScrollBar, Label, Volt meter (Volt), thermometer (temperature)

Dial Element Analysis:

Stateindicatorcarlcons\

Problem:

There are currently 24 controls

1 The control's Text property cannot be hidden

2 How the dial shows Float√ has been resolved May 4, 2011

Ø How to implement control transparency

This is not the same as the online description. In general, when you design form, you can directly know the cascade relationship between controls, you can set such as Parent property. The requirement of the project is to do a batch of controls, and the application of the control does not know where. Some things just can't be set.

Reference page: http://www.cnblogs.com/chengxiaohui/articles/1921608.html May 5, 2011

Ø Delegate Assignment

http://binyun530.blog.163.com/blog/static/14877674200821111263370/

Necessary operations for communication between threads

Ø adding events for controls

Http://wenku.baidu.com/view/3f001cec102de2bd96058830.html

Http://wenku.baidu.com/view/133cd942a8956bec0975e3c3.html

There is also an important question: how to adjust the control's upper and lower layer relationships by the control hierarchy problem.

Keywords: control stacking order

Reference Document: http://zhl198118.blog.163.com/blog/static/12318524120098293220416/

Http://topic.csdn.net/u/20110307/11/4da9200d-0ecd-4fb2-bd26-e21a38a617d3.html

http://211.103.139.223/winm/content_files/NET%BE%AB%BC%F2%BF%F2%BC%DC%B3%CC%D0%F2%C9%E8%BC%C6%A3%BAC_%B0% E6.pdf May 12, 2011

Serial Port Programming:

1 C # serial operation: http://blog.csdn.net/wuyazhe/archive/2010/05/17/5598945.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.