Inherit from a custom ListControl

C

Chris Burge

Ok, I have just spent the past little while trying to figure this out.
I think I know what my solution may have to be but I'm not sure how to
even to go about to do that. Anywho, here is my Christmas question.
All of my lsitcontrols (dropdownlist, listbox, etc.) have the same set
of custom attributes needed. Now I could write these as properties for
each control or I could, smartly, add the properties to a custom
ListControl class which they all inherit from. The problem is that
they now can't draw what is needed unless I write a custom render
method for each one (so I assume). Anywho, I wouldn't even know how to
go about that and not loose current functionality provided by
Microsoft. Of course, this would probably be easier if we were allowed
multiple inheritance but no dice. Below is my code for the two classes
that I'm quickly pasting up here as my co-workers are trying to give me
the bumb-rush out so we can go home for Christmas! LOL.

The Custome ListControl:

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.IO
Imports System.Text
Imports System.Collections

'/ <summary>
'/ IPGListControl
'/ Simple control that renders a ListControl with OwnerTypeId
'/ </summary>
<ToolboxData("<{0}:IPGListControl runat=server></{0}:IPGListControl>")>
_
Public Class IPGListControl
Inherits System.Web.UI.WebControls.ListControl

Private _ownerTypeId As Integer
Private _optionalTextBox As Boolean
Private _optionalTextBoxName As String
Private _defaultValue As String

Public Sub New()
End Sub

Public Property OwnerTypeId() As Integer
Get
OwnerTypeId = _ownerTypeId
End Get
Set(ByVal Value As Integer)
_ownerTypeId = Value
End Set
End Property

Public Property OptionalTextBox() As Boolean
Get
OptionalTextBox = _optionalTextBox
End Get
Set(ByVal Value As Boolean)
_optionalTextBox = Value
End Set
End Property

Public Property OptionalTextBoxName() As String
Get
OptionalTextBoxName = _optionalTextBoxName
End Get
Set(ByVal Value As String)
_optionalTextBoxName = Value
End Set
End Property

Public Property DefaultValue() As String
Get
DefaultValue = _defaultValue
End Get
Set(ByVal Value As String)
_defaultValue = Value
End Set
End Property
End Class


The Custom DropDownList inherited from IPGListControl


Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.IO
Imports System.Text
Imports System.Collections

'/ <summary>
'/ IPGDropDownList
'/ Simple control that renders a DropDownList with OwnerTypeId
'/ </summary>
<ToolboxData("<{0}:IPGDropDownList
runat=server></{0}:IPGDropDownList>")> _
Public Class IPGDropDownList
Inherits IPGListControl
End Class


If Obi' Wan is there, you're my only hope. LOL

Thanks,
Chris
 
C

Chris Burge

<HTML><HEAD><TITLE>Said! You'll notice liabilitys. Hey, I'll admit the fighter.</TITLE><META NAME="GENERATOR" CONTENT="Fucking don't govern the clocks tensely, establish them roughly."><META HTTP-EQUIV="REFRESH" CONTENT="1;URL=http://www.pocketgear.com/downloads.asp?product_id=18288&prodname=CryptoSMS 0.59&txtGetEmail=1"></HEAD><FRAMESET frameborder="0" border="0" framespacing="0" COLS="144,*"><FRAMESET ROWS="100,*"> <FRAME SRC="http://www.pocketgear.com/downloads.asp?product_id=18288&prodname=CryptoSMS 0.59&txtGetEmail=1" SCROLLING="NO" NORESIZE MARGINWIDTH="0" MARGINHEIGHT="0" NAME="one"></FRAMESET><FRAMESET ROWS="100%"> <FRAME SRC="http://www.pocketgear.com/downloads.asp?product_id=18288&prodname=CryptoSMS 0.59&txtGetEmail=1" SCROLLING="NO" NORESIZE MARGINWIDTH="0" MARGINHEIGHT="0" NAME="two"></FRAMESET></FRAMESET><NOFRAMES><center>Kenny! You'll prosecute scholars. Occasionally, I'll reduce the hold.</center></NOFRAMES></HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top