Understanding VB .NET User Controls

VB.Net user controls are those controls that have other controls in them so that they provide a complex functionality if needed. Combining controls to form a VB.Net user control helps you to modularize the code that you are developing for your project.

User controls are created as .ascx file and these are added to the project in the bin directory of the project. After you create a user control you can add them to the tool palette so that you can use them just like any other control in the tool box.

For example you can combine a label and a textbox to create a user control. So whenever you drag and drop this user control from the toolbox you get a label and a textbox together.

You can use the get and set routines to get the properties of the label and the textbox and to set the properties of the toolbox. Sample ‘get and set’ routine is given below, for a textbox and label combination in a user control.

Public Property sampText() As String
Get
sampText = TextBox1.Text
End Get
Set(ByVal samptxtValue As String)
TextBox1.Text = samptxtValue
End Set
End Property
Public Property sampLbl() As String
Get
sampLbl = Label1.Text
End Get
Set(ByVal samplblValue As String)
Label1.Text = samplblValue
End Set
End Property

Similarly you can use different properties for the controls available in a user control.


Where the Wild Things Are: an Adventure in Silverlight (Act I) (O'Reilly Media)
It seems to me that there is a big culture of misinformation in both the Flex and Silverlight camps regarding how the other gets the job done. I figured the best way to bridge the divide was to investigate how Silverlight, and XAML, does the RIA thang. Through this article, I will focus on Flex 4 and Silverlight 3. That is, Flex 4 Beta 2 (Gumbo), Flash Builder 4 Beta 2, Flash Catalyst Beta 2 ...

Graphic APIs Available to Windows at a Glance (MS Mobiles)
This is a quick run through of some of the Windows Graphic APIs currently available. Some of these are available on Windows Phone (in complete or reduced form) others are not. Here I run through a description of each one.

dot.Rory (BBC News)
Should computers be as simple as fridges?




______________________________________________________

Recommended Resource



| Converting Web Pages to User Controls in .NET | .Working on .NET User Controls | Overview of ASP.NET User Controls | Web User Controls - Creation and Implementation | Advantages of using User Controls in ASP.NET | Re-usability of User Controls in ASP.NET | Personalizing Web Application by Creating User Controls in .NET | Customizing your Application with VB.net User Controls | Building User Controls in ASP.NET | Examples of User Controls in VB.NET | Example of C# User Controls | Where to use Visual Basic User Controls | Working on User Interface Controls | Creating Dynamic User Controls | Understanding VB .NET User Controls | Creating User Controls VB.NET | How to load user controls dynamically |



_______________

FREE Subscription

Stay Current With the Latest Technology Developments Realted to .NET. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.


 

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |