Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Question: Add Property to UserControl
 

Question: Add Property to UserControl

Hi

Simple question: I´m creating a new user control that its like a bar. Its a panel and a Microsoft.VisualBasic.PowerPack.RectangleShape to add a Border, and an optional Label.
I want to create a Property to choose the label align in the panel control in the F4 menu.
k?

thanks mate
vmDillenburg  Monday, April 20, 2009 6:07 PM
Add a property like this...

    Public Property LabelAlign() As System.Drawing.ContentAlignment
        Get
            Return Me.Label1.TextAlign
        End Get
        Set(ByVal value As System.Drawing.ContentAlignment)
            Me.Label1.TextAlign = value
        End Set
    End Property

Regards,

Wayne Taylor
Regards, Wayne Taylor
webtubbs  Tuesday, April 21, 2009 7:04 AM
Add a property like this...

    Public Property LabelAlign() As System.Drawing.ContentAlignment
        Get
            Return Me.Label1.TextAlign
        End Get
        Set(ByVal value As System.Drawing.ContentAlignment)
            Me.Label1.TextAlign = value
        End Set
    End Property

Regards,

Wayne Taylor
Regards, Wayne Taylor
webtubbs  Tuesday, April 21, 2009 7:04 AM

You can use google to search for other answers

Custom Search

More Threads

• Localized Forms and "$this.Name"
• Double-Click on form button or form Titlebar causes Visual Studio to crash?
• Mmicrosoft Outlook Integration with VB.NET Code
• Cross-container component connection
• DomainUpDown->SelectedIndex property not available in Forms Designer
• Redo/Undo in CodeDomDesignerLoader
• datagridview design
• Creating Custom Controls
• ToolboxBitmapAttribute doesn't work
• CodeDomSerializer and resx