Home All Groups Group Topic Archive Search About

Collection property problem

Author
20 Mar 2006 10:05 PM
Roman
Hello

I have a custom component inherited from TreeView control with only one Node
added.
When I build the component, drag it from Toolbox to a Form and run my
project
there are two(!) nodes instead of one.
The same thing happens with Listbox and other controls which have collection
properties.
Is there a way to avoid such behavior?

Thanks in advance,
Roman

Author
21 Mar 2006 6:37 AM
MS MVP ³sÀA¶¯ for VB.NET
Dear Roman,

By default, there is no node added without any of your code.
Did you add some code like

treeView1.Nodes.Add([nodeName])

Did you try to call the coding from component and also from your winForm?


--
Hope this help and welcome to reply the testing result.

Regards
Ken Lin, Kam Hung
Founder and VP of Hong Kong .NET User Group(http://HKNetUG.com)
MCP, MCP+I, MCDST, MCSA, MCSE(NT4 & win2k),
MCSE+I, MCDBA(SQL7 & SQL2K), MCSD(VB6 & .NET), MCAD(.NET)
Microsoft Community Star(Hong Kong & Taiwan)
Microsoft Most Valuable Professional(.NET since 2003)
MCT2004 & 2005


Show quoteHide quote
"Roman" <[rom***@mbsnetinc.com]> wrote in message
news:%23DU$XpGTGHA.4960@TK2MSFTNGP12.phx.gbl...
> Hello
>
> I have a custom component inherited from TreeView control with only one
Node
> added.
> When I build the component, drag it from Toolbox to a Form and run my
> project
> there are two(!) nodes instead of one.
> The same thing happens with Listbox and other controls which have
collection
> properties.
> Is there a way to avoid such behavior?
>
> Thanks in advance,
> Roman
>
>
>
>
Author
21 Mar 2006 2:47 PM
Roman
The only code I wrote in code window of my component is:
    Inherits TreeView.
I do add a node myself and do it by going to compoment design window, and
modifying
Nodes property in Properties window.

Thanks,
Roman

Show quoteHide quote
"MS MVP ³sÀA¶¯ for VB.NET" <kenlin2***@hotmail.com.no-spam> wrote in message
news:usNrnILTGHA.1688@TK2MSFTNGP11.phx.gbl...
> Dear Roman,
>
> By default, there is no node added without any of your code.
> Did you add some code like
>
> treeView1.Nodes.Add([nodeName])
>
> Did you try to call the coding from component and also from your winForm?
>
>
> --
> Hope this help and welcome to reply the testing result.
>
> Regards
> Ken Lin, Kam Hung
> Founder and VP of Hong Kong .NET User Group(http://HKNetUG.com)
> MCP, MCP+I, MCDST, MCSA, MCSE(NT4 & win2k),
> MCSE+I, MCDBA(SQL7 & SQL2K), MCSD(VB6 & .NET), MCAD(.NET)
> Microsoft Community Star(Hong Kong & Taiwan)
> Microsoft Most Valuable Professional(.NET since 2003)
> MCT2004 & 2005
>
>
> "Roman" <[rom***@mbsnetinc.com]> wrote in message
> news:%23DU$XpGTGHA.4960@TK2MSFTNGP12.phx.gbl...
>> Hello
>>
>> I have a custom component inherited from TreeView control with only one
> Node
>> added.
>> When I build the component, drag it from Toolbox to a Form and run my
>> project
>> there are two(!) nodes instead of one.
>> The same thing happens with Listbox and other controls which have
> collection
>> properties.
>> Is there a way to avoid such behavior?
>>
>> Thanks in advance,
>> Roman
>>
>>
>>
>>
>
>