473,698 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net usercontrol inheritance designer

I am trying to setup a usercontrol as a base class, so that I can
derive my usercontrols from it.

the base is pretty simple:

Imports System.Xml
Public Class usrBase
Inherits System.Windows. Forms.UserContr ol

Public Overridable Sub MethodA()
End Sub
End Class

'derived classes
Public Class usrMyControl
Inherits usrBase
....
....
End Class

The issue is that I can't see my form usrMyControl in the designer
anymore and gives an error that says " The designer must create an
instance of type 'usrBase' but it cannot because the type is declared
as abstract.".

However, I thought the class was only consider "abstract" when the
MustInherit/MustOverride clauses are used, which I'm not using them
here. Why does it think it is still abstract ?

What am I doing wrong ? Is there another way to do this ?

Mark

Feb 19 '07 #1
2 3004
If this is literally the code you have, then I would attribute it to a
designer bug.

"marfi95" <ma*****@yahoo. comwrote in message
news:11******** *************@q 2g2000cwa.googl egroups.com...
>I am trying to setup a usercontrol as a base class, so that I can
derive my usercontrols from it.

the base is pretty simple:

Imports System.Xml
Public Class usrBase
Inherits System.Windows. Forms.UserContr ol

Public Overridable Sub MethodA()
End Sub
End Class

'derived classes
Public Class usrMyControl
Inherits usrBase
...
...
End Class

The issue is that I can't see my form usrMyControl in the designer
anymore and gives an error that says " The designer must create an
instance of type 'usrBase' but it cannot because the type is declared
as abstract.".

However, I thought the class was only consider "abstract" when the
MustInherit/MustOverride clauses are used, which I'm not using them
here. Why does it think it is still abstract ?

What am I doing wrong ? Is there another way to do this ?

Mark

Feb 19 '07 #2
["Followup-To:" header set to microsoft.publi c.dotnet.langua ges.vb.]
On 2007-02-19, marfi95 <ma*****@yahoo. comwrote:
I am trying to setup a usercontrol as a base class, so that I can
derive my usercontrols from it.

the base is pretty simple:

Imports System.Xml
Public Class usrBase
Inherits System.Windows. Forms.UserContr ol

Public Overridable Sub MethodA()
End Sub
End Class

'derived classes
Public Class usrMyControl
Inherits usrBase
...
...
End Class
Is this your exact code? Something ins't right there....

--
Tom Shelton
Feb 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8307
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am showing one transparent form (form3) when ever user preseed left mouse button. 3) The form3 has one transparent user control (usercontrol2) that paints circles. That measn the circles will show on top the usercontrol1 image. 4) The form3 border style...
2
2214
by: Joe | last post by:
OK, so i searched this forum, and it seems like my question has come close to being answered a dozen times, but never fully... I have a very simple control that inherits from UserControl. It has no child controls, just properties and custom drawing. I would like one of these properties to be 'Text'. So i setup a private _Text field (base.Text not accessible) and public String Text property. I have tried using both 'override' and 'new'...
2
2665
by: bill yeager | last post by:
When trying to run my web project, I get the following error: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes the
4
1415
by: Joel Barsotti | last post by:
On certain pages I want to have a user control that is derived not directly from the usercontrol class, but from a class that extends the UserControl class so my objects will have a some guaranteed functionality. But my problem is that when I do this, the ascx file won't go into design view. Other than switching the inheritance of my ascx.cs files back and forth I don't know a way to get around this.
0
2462
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls which are not behaving as I would expect. Specifically, if there is a command button external to the usercontrol which is activated by a shortcut key (eg Alt-B), the command button Click event handler code 'executes' even though the textbox set...
0
2435
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852 (http://support.microsoft.com/kb/810852), but then I realized that the hotfix mentioned was in .Net v1.1, which I am using. I took the sample from that article and recreated the situation I see in my application. (Code included below.) If you run the...
5
1515
by: Pieter | last post by:
Hi, I'm getting a really terrible and anoying bug/problem in VS.NET 2005: 1. Create a new Windows Application. 2. Add a new class Class1. 3. Add a usercontrol UserControl1. 4. Add a public instance of Class1 to UserControl1 (with WithEvents): "Public WithEvents ThisClass As New Class1". 5. Build the Solution, and put an instance of UserControl1 on Form1.
7
2511
by: steve.kaye | last post by:
I am writing a number of controls which use inheritance and I have a problem that I do not know how to solve. It's best if I describe the class structure I want. Grid - derives from UserControl and contains most of the functionality required of a basic grid. ViewGrid, EditGrid and TreeGrid - all derive from Grid The problem I have is that I never want the programmer to create an
1
2313
by: Stefan Hoffmann | last post by:
hi @all, I have a lot of similar looking pages (TabPage) with a lot of code behind. I want to extract these page contents to user controls. Because they have all the same basic layout and some code in common, I like to have this inheritance chain: public class AbstractContent : System.Windows.Forms.UserControl {} public class ConcreteContent : AbstractContent {}
0
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8855
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.