Inheriting from UserControls



  • 1. Third party tool for parsing HTML?
    Are there any good HTML parsing tools available for VB.NET? I'd like something that will list: - tables (table, tr, td) - anchor tags - image tabs - DIVs and so. For example, it may list all <A> tags in an array. I can then search each entry of the array looking for a specific parameter in a link. Once that is found, I then look for the associated text between <a>this text here</a>. It would need to be some type of tree structure. Any suggestions? Thanks, Brett
  • 2. OT: Third party tool for parsing HTML?
    ??? I thought you had problems with the hamster again however now I see you use OE again.
  • 3. What is the purpose of table.location in Report document
    Dear all, Now, I want to have a set of reports with same format driving data from different DB. So I set the code in ReportDocument like follow: ... ReportTemp.Load(_report) For Each table In ReportTemp.Database.Tables If table.Location.ToUpper.Substring(0, 7) = "DTS_SEA" Then table.Location = String.Concat(pPrintSetting.DatabaseName, ".dbo.", table.LogOnInfo.TableName) End If logoninfo = table.LogOnInfo With logoninfo.ConnectionInfo .ServerName = pPrintSetting.ServerName .DatabaseName = pPrintSetting.DatabaseName .UserID = pPrintSetting.UserID .Password = pPrintSetting.Password End With table.ApplyLogOnInfo(logoninfo) Next table ... I would like to ask what is the purpose of table.Location. When I check the value of it, it show "DatabaseA.dbo.tablename". So I try to change it to "DatabaseB.dbo.tablename" but it fails. The error message is "invalid table number." What this means? Please help. Thanks a lot, Ray

Inheriting from UserControls

Postby Charles Law » Wed, 03 Mar 2004 04:44:04 GMT

I want a set of controls that all have a border, like a group box. I thought
I would create a base control containing just a group box from which my set
of controls could inherit. Assuming that this is the right approach (please
tell me if it is not), how then do I make it so that the group box cannot be
moved around on my set of controls, but is also able to act as container for
other controls?

If I leave the modifier of the group box as Friend, or Private, then the
group box appears locked on the inheriting controls, but I cannot drop new
controls onto it. If I change the modifier to Protected, Protected Friend,
or Public, then I can drop controls onto the group box, but I can also move
the group box around on the inheriting control.

Is there something else I must do?



RE: Inheriting from UserControls

Postby craigv_ » Sun, 07 Mar 2004 06:13:34 GMT

Hi Charles,

It maybe easier to simply inherit from GroupBox. The problem is you won't 
have a designer when you write the control so you'll have to do everything 
in code.

Craig VB. NET Team
This reply is provided AS IS, without warranty (express or implied).


Re: Inheriting from UserControls

Postby Charles Law » Sun, 07 Mar 2004 07:33:51 GMT

Hi Craig

I see what you mean. I have just tried it, but I think the absence of a
designer will be a problem. I want to be able to lay out my inheriting
control visually, rather than 'guess' the position of things in code.

It's a shame that inheriting from GroupBox doesn't give a designer inside a
group box.



Similar Threads:

1.Inherited UserControls do not in appear in Toolbox (VB.NET 200

I believe this is a bug in VB.Net 2003.  I finally gave up on adding controls 
to the toolbox and just add a reference then instantiate them and add them to 
my forms in code.  Maybe SP1 for VB.Net 2003 will resolve this bug.
Dennis in Houston

" XXXX@XXXXX.COM " wrote:

> Hello Newsgroup,
> I have just found out that adding my EXE manually to the Toolbox solves
> the problem. Can I switch it somehow on, that just after compiling the
> UserControl appears automatically in the Toolbox?
> What if I change the inherited UserControl? Do I have to recompile and
> readd manually to update the controls on the form? Will I even have to
> pull every control again on the form to get new functionality?
> Thanks,
> Bart (Desperate...)

2.MyBase.New Question on Inherited UserControls

3.Inherited UserControls do not in appear in Toolbox (VB.NET 2005)

Dear Newsgroup,
I'm an old VB6.0 developper who switched some time ago to VB.NET 2005.
I really like that new Visual Studio. However, something is going wrong
now and I can't figure out, what it is...
I was playing around with UserControls which are inherited from
standard .NET controls to make myself some transparent controls.
Suddenly I realized that after bulding my project those UserControls do
not appear in the Toolbox anymore. I had before an error which caused
the designer to crash. I've searched MSDN, usenet and web. Uninstalled
.NET Framework 1.1, reinstalled VB.NET 2005 (Express). There seems to
be such a problem about .NET Studio 2003. However, I'm using 2005.
When I open an old project, my UserControls are still there and I can
add new ones. But it won't work in new projects.
Maybe I'm doing something terribly stupid, so I would like to describe
how I think UserControls should be generated. Am I overseeing
1. Open new Windows Application project.
2. Add Class to Project.
3. E.g.:
Public Call1
Public Class ListBoxExtended
Inherits System.Windows.Forms.ListBox
Public Sub TestListBox
Msgbox "Test"
end sub
end class
end class
4. Compile/Build, no erros.
5. Going to Designer: just nothing, no "ListBoxExtended"

I'm really desperate in the meanwhile. Any hints and comments are
Thanks a lot,

4.Inheriting usercontrols

I swear I've done my research, and now I was just hoping someone could
explain this to me.

I've got a base class (usercontrol) that I am using just as an
interface.  Meaning, I've defined several MustOverride subs in there,
and also a public property.

I'm going to inherit a bunch of usercontrols from this one superclass
(terminology correct?) and then they all have to make sure they can
respond to that set of functions that I've defined.  Sounds good to me.

However, I keep getting the error of "The designer must create an
instance of type 'EncLO.ucLoanSuper' but it cannot because the type is
declared as abstract.

Right, I've seen the advice of wrapping my super class definition in
#If DEBUG....  However, that defeats the purpose, right?  I mean, I can
actually declare my class normally (without the MustInherit) and then
just make Overridable subs instead of MustOverride subs.  But that
won't FORCE me to implement all of those subs in all the child
usercontrols.  It doesn't do me any good to do this only at runtime,
because by that time it is too late.

Am I making sense?  Any other solution that anyone can think of to
force the usercontrols that inherit from my superclass to implement
that set of subs?


5.UserControls in UserControls?

I'm preparing a set of WinForms controls, inherited from the standard
ones, that other Developers will be using for a particular application.
I'm trying to build a /single/ assembly that will provide all of the
in one go.  However, one of the controls I'd /like/ to provide them with
is an amalgamation of several others /in the same assembly/.

I'm currently doing this by referencing my own built Dll and, every time
I rebuild the Dll, removing and re-adding [all] my controls from the

Is there a better way of using User Controls in the same project?
(running VB.Net, VS 2003, on Windows 2000)

    Phill  W.

6. Visually inheriting from abstract/generic UserControls in CF

7. Adding usercontrols to other usercontrols

8. implementing inherited control Ken Tucker - Inherited DataGrid Class

Return to VB.NET


Who is online

Users browsing this forum: No registered users and 19 guest