Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Server Controls Design-Time Sub Property

Status
Not open for further replies.

onedizzydevil

Programmer
Mar 24, 2001
103
US
Does anyone have any ideas on how to do the Design-Time Sub Properties for a control.

For example, drag the Drop Down List Control to a web page, go to the properties and you see the little plus sign beside "Font" clicked it and you will see a bunch of Sub Properties of "Font".

I need that functionality and I can not find any references to actually programming it (in VB.NET). Every reference says it can do it but no REAL instructions on actually doing it.

Any help would be greatly appreciated.

Wayne Sellars

"Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0."
 
Nevermind I figured it out!

Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.web.UI.Design

Namespace Web

<DefaultProperty(&quot;Text&quot;), ToolboxData(&quot;<{0}:SignIn runat=server></{0}:SignIn>&quot;)> Public Class SignIn
Inherits Control
Implements INamingContainer

#Region &quot; Properties &quot;

Private _SignIn As New ButttonProperties
Private _Cancel As New ButttonProperties

<Bindable(True), Category(&quot;Buttons&quot;), Description(&quot;Indicated the placement of the elements.&quot;), PersistenceMode(PersistenceMode.InnerProperty), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public ReadOnly Property Submit() As ButttonProperties
Get
Return _SignIn
End Get
End Property

<Bindable(True), Category(&quot;Buttons&quot;), Description(&quot;Indicated the placement of the elements.&quot;), PersistenceMode(PersistenceMode.InnerProperty), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public ReadOnly Property Cancel() As ButttonProperties
Get
Return _Cancel
End Get
End Property

#End Region

Protected Overrides Sub CreateChildControls()
...
End Sub

End Class

<TypeConverter(GetType(ExpandableObjectConverter)), Description(&quot;&quot;)> _
Public Class ButttonProperties

Enum Style
Link
Form
Image
End Enum

Private _Text As String
Private _URL As String
Private _Type As Style = Style.Form

<Bindable(True), DefaultValue(&quot;&quot;), NotifyParentProperty(True), Description(&quot;&quot;), RefreshProperties(RefreshProperties.Repaint)> _
Public Property Text() As String
Get
Return _Text
End Get

Set(ByVal Value As String)
_Text = Value
End Set
End Property

<Bindable(True), DefaultValue(&quot;&quot;), NotifyParentProperty(True), Description(&quot;&quot;), RefreshProperties(RefreshProperties.Repaint)> _
Public Property Type() As Style
Get
Return _Type
End Get

Set(ByVal Value As Style)
_Type = Value
End Set
End Property

<DefaultValue(&quot;&quot;), NotifyParentProperty(True), Description(&quot;&quot;), Editor(GetType(ImageUrlEditor), GetType(System.Drawing.Design.UITypeEditor))> _
Property URL() As String
Get
Return _URL
End Get

Set(ByVal Value As String)
_URL = Value
End Set
End Property

End Class

End Namespace

Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top