Click here to Skip to main content
15,918,808 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Converting Msflexgrid content to Excel Pin
Dave Kreskowiak2-Apr-08 3:34
mveDave Kreskowiak2-Apr-08 3:34 
Questionweb service access control Pin
Ismaeel1-Apr-08 16:08
Ismaeel1-Apr-08 16:08 
GeneralRe: web service access control Pin
Dave Kreskowiak2-Apr-08 3:32
mveDave Kreskowiak2-Apr-08 3:32 
GeneralFind PivotTable in Excel Pin
Bomb_shell1-Apr-08 9:58
Bomb_shell1-Apr-08 9:58 
GeneralRe: Find PivotTable in Excel Pin
ne0h1-Apr-08 19:56
ne0h1-Apr-08 19:56 
GeneralRe: Find PivotTable in Excel Pin
Mitch F.1-Apr-08 20:15
Mitch F.1-Apr-08 20:15 
GeneralRe: Find PivotTable in Excel Pin
Bomb_shell2-Apr-08 15:14
Bomb_shell2-Apr-08 15:14 
QuestionMustInherit UserControl [modified] Pin
vocaris1-Apr-08 9:39
vocaris1-Apr-08 9:39 
Hello Community,
I'm trying to write a dll that contains a abstract UserControl (Name: StepBase). I wrote two UserControls that inherits the abstract one and now when I open one of the inherited I got the following message:
The designer must create an instance of type 'StepBase' but it cannot
because the type is declared as abstract.

On the internet I found a website with a solution but it do't work. On the website the author wrotes that I have to add a custom TypeDescriptor like this:
<TypeDescriptionProvider(GetType(ConcreteClassProvider))> _<br />
Public MustInherit Class StepBase 


Additional I have to add a ConctreteUserControl-Class:
Public Class ConcreteStepBase<br />
Inherits StepBase<br />
End Class 


Here is the custom TypeDescriptor:
Public Class ConcreteClassProvider<br />
Inherits TypeDescriptionProvider<br />
<br />
Public Sub New()<br />
MyBase.New(TypeDescriptor.GetProvider(GetType(StepBase)))<br />
End Sub<br />
<br />
Public Overrides Function GetReflectionType(ByVal objectType As Type,<br />
ByVal instance As Object) As Type<br />
If objectType Is GetType(StepBase) Then<br />
Return GetType(ConcreteStepBase)<br />
End If<br />
Return MyBase.GetReflectionType(objectType, instance)<br />
End Function<br />
<br />
Public Overrides Function CreateInstance(ByVal provider As<br />
IServiceProvider, ByVal objectType As Type, ByVal argTypes() As Type, ByVal<br />
args() As Object) As Object<br />
If objectType Is GetType(StepBase) Then<br />
objectType = GetType(ConcreteStepBase)<br />
End If<br />
Return MyBase.CreateInstance(provider, objectType, argTypes, args)<br />
End Function<br />
End Class 


I get this solution from the following website:
http://www.urbanpotato.net/default.aspx/document/2001

The provided solution does not work; I added a throw new Exception to the constructor of my custom TypeDescriptor and this Exception is not thrown, so that I think, the TypeDescriptor will not be used.

What is my fault?

Manfred

modified on Tuesday, April 1, 2008 5:08 PM

GeneralRe: MustInherit UserControl Pin
Dave Kreskowiak2-Apr-08 3:29
mveDave Kreskowiak2-Apr-08 3:29 
QuestionTextFieldParser language question Pin
Vinny_681-Apr-08 4:48
Vinny_681-Apr-08 4:48 
GeneralRe: TextFieldParser language question Pin
Luc Pattyn1-Apr-08 5:38
sitebuilderLuc Pattyn1-Apr-08 5:38 
GeneralRe: TextFieldParser language question Pin
Vinny_682-Apr-08 2:06
Vinny_682-Apr-08 2:06 
GeneralRe: TextFieldParser language question Pin
Luc Pattyn2-Apr-08 2:27
sitebuilderLuc Pattyn2-Apr-08 2:27 
GeneralNew to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Adam.m.Nelson1-Apr-08 3:30
Adam.m.Nelson1-Apr-08 3:30 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Mitch F.1-Apr-08 9:59
Mitch F.1-Apr-08 9:59 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Adam.m.Nelson1-Apr-08 10:33
Adam.m.Nelson1-Apr-08 10:33 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. [modified] Pin
Mitch F.1-Apr-08 10:39
Mitch F.1-Apr-08 10:39 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Adam.m.Nelson2-Apr-08 2:17
Adam.m.Nelson2-Apr-08 2:17 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
ChandraRam1-Apr-08 21:05
ChandraRam1-Apr-08 21:05 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Adam.m.Nelson2-Apr-08 2:19
Adam.m.Nelson2-Apr-08 2:19 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
ChandraRam2-Apr-08 19:15
ChandraRam2-Apr-08 19:15 
AnswerRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Adam.m.Nelson3-Apr-08 2:19
Adam.m.Nelson3-Apr-08 2:19 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
ChandraRam3-Apr-08 3:05
ChandraRam3-Apr-08 3:05 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
Adam.m.Nelson3-Apr-08 8:15
Adam.m.Nelson3-Apr-08 8:15 
GeneralRe: New to VB - NewFile Dialog / SaveFile Dialog help needed. Pin
ChandraRam3-Apr-08 8:22
ChandraRam3-Apr-08 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.