Examples of User Controls in VB.NETWith the user controls you can easily combine different controls and make them as a single control and even add them to the toolbox. After you add them to the tool box you can just drag and drop them as you would with the other controls in the toolbox to add them to in the design view. For example if you want to create a user control that would have a label and a textbox together, then you can create a new project using the Visual Studio .Net and select the option of Web Control Library. This would create the .ascx file needed for creating the user control. Now you can drag and drop the label and a textbox in the design view. Double click to open the code window and in that you can set the properties for the label and the text box as given below in VB.Net. Public
Property propText() As String Once you have created such a user control, now you can right click the toolbox and select customize. Now add the .dll file that is created and you will find the user control created be added to the toolbox palette. Now you are ready to use the user control as you would with the other controls in the toolbox. A simple search on the internet would provide you with a lot of such examples of user controls in VB.Net.
|