Home All Groups Group Topic Archive Search About

How to extend a Windows Forms Control

Author
13 Jan 2006 7:37 PM
Al Reid
I need to extend a couple of controls to add a few custom properties, methods, etc.  What is the correct way to do this.  My first
attempt (inheriting the control and adding the properties and methods) seems to work.  However, several times the IDE has lost the
controls.  BTW, I'm using VB2005.

--
Al Reid

"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so."  --- Mark Twain

Author
13 Jan 2006 7:42 PM
Herfried K. Wagner [MVP]
"Al Reid" <arei***@reidDASHhome.com> schrieb:
>I need to extend a couple of controls to add a few custom properties,
>methods, etc.  What is the correct way to do this.  My first
> attempt (inheriting the control and adding the properties and methods)
> seems to work.  However, several times the IDE has lost the
> controls.  BTW, I'm using VB2005.

Mhm...  This should basically work.  Alternatively you could write an
extender control.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
13 Jan 2006 7:53 PM
Al Reid
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:OoYgolHGGHA.532@TK2MSFTNGP15.phx.gbl...
> "Al Reid" <arei***@reidDASHhome.com> schrieb:
> >I need to extend a couple of controls to add a few custom properties,
> >methods, etc.  What is the correct way to do this.  My first
> > attempt (inheriting the control and adding the properties and methods)
> > seems to work.  However, several times the IDE has lost the
> > controls.  BTW, I'm using VB2005.
>
> Mhm...  This should basically work.  Alternatively you could write an
> extender control.
>

It works great until the controls get lost.  The form Designer looses the controls, but keeps the Declaration (Withevents ..).   One
of the extended controls is a listView.  When it gets lost, the ColumnHeaders don't get lost, but the Listview does.  Very Strange!


--
Show quoteHide quote
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>