ईवेंट्स
17 मार्च, 9 pm - 21 मार्च, 10 am
साथी डेवलपर्स और विशेषज्ञों के साथ वास्तविक दुनिया के उपयोग के मामलों के आधार पर स्केलेबल एआई समाधान बनाने के लिए मीटअप श्रृंखला में शामिल हों।
अभी पंजीकरण करेंयह ब्राउज़र अब समर्थित नहीं है.
नवीनतम सुविधाओं, सुरक्षा अपडेट और तकनीकी सहायता का लाभ लेने के लिए Microsoft Edge में अपग्रेड करें.
If you want to have a special icon for your control appear in the Toolbox of Visual Studio, you can specify a particular image by using the ToolboxBitmapAttribute. This class is an attribute, a special kind of class you can attach to other classes. For more information about attributes, see Attributes overview (Visual Basic) for Visual Basic or Attributes (C#) for C#.
Using the ToolboxBitmapAttribute, you can specify a string that indicates the path and file name for a 16 by 16 pixel bitmap. This bitmap then appears next to your control when added to the Toolbox. You can also specify a Type, in which case the bitmap associated with that type is loaded. If you specify both a Type and a string, the control searches for an image resource with the name specified by the string parameter in the assembly containing the type specified by the Type parameter.
Add the ToolboxBitmapAttribute to the class declaration of your control before the Class
keyword for visual Basic, and above the class declaration for Visual C#.
' Specifies the bitmap associated with the Button type.
<ToolboxBitmap(GetType(Button))> Class MyControl1
' Specifies a bitmap file.
End Class
<ToolboxBitmap("C:\Documents and Settings\Joe\MyPics\myImage.bmp")> _
Class MyControl2
End Class
' Specifies a type that indicates the assembly to search, and the name
' of an image resource to look for.
<ToolboxBitmap(GetType(MyControl), "MyControlBitmap")> Class MyControl
End Class
// Specifies the bitmap associated with the Button type.
[ToolboxBitmap(typeof(Button))]
class MyControl1 : UserControl
{
}
// Specifies a bitmap file.
[ToolboxBitmap(@"C:\Documents and Settings\Joe\MyPics\myImage.bmp")]
class MyControl2 : UserControl
{
}
// Specifies a type that indicates the assembly to search, and the name
// of an image resource to look for.
[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]
class MyControl : UserControl
{
}
Rebuild the project.
नोट
The bitmap does not appear in the Toolbox for autogenerated controls and components. To see the bitmap, reload the control by using the Choose Toolbox Items dialog box. For more information, see Walkthrough: Automatically Populating the Toolbox with Custom Components.
.NET Desktop feedback प्रतिक्रिया
.NET Desktop feedback एक ओपन सोर्स प्रोजेक्ट है. प्रतिक्रिया प्रदान करने के लिए लिंक का चयन करें:
ईवेंट्स
17 मार्च, 9 pm - 21 मार्च, 10 am
साथी डेवलपर्स और विशेषज्ञों के साथ वास्तविक दुनिया के उपयोग के मामलों के आधार पर स्केलेबल एआई समाधान बनाने के लिए मीटअप श्रृंखला में शामिल हों।
अभी पंजीकरण करेंदस्तावेज़ीकरण
Inherit from Existing Controls - Windows Forms .NET Framework
Learn how to inherit from existing controls so that another control has all of its functionality and visual properties.
Walkthrough: Authoring a Composite Control with Visual C# - Windows Forms .NET Framework
Learn how to author a composite control with C# in order to provide a means by which custom graphical interfaces can be created and reused.
Make UserControl act as control - C#
Describes how to make a UserControl object act as a control container at design time after you add the UserControl object to a Windows Form.