Click here to Skip to main content
15,892,059 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: WinForms ListView Pin
#realJSOP5-Dec-09 0:38
mve#realJSOP5-Dec-09 0:38 
GeneralRe: WinForms ListView Pin
Abhinav S5-Dec-09 3:35
Abhinav S5-Dec-09 3:35 
AnswerRe: WinForms ListView Pin
Pete O'Hanlon4-Dec-09 22:31
mvePete O'Hanlon4-Dec-09 22:31 
GeneralRe: WinForms ListView Pin
#realJSOP5-Dec-09 0:36
mve#realJSOP5-Dec-09 0:36 
GeneralRe: WinForms ListView Pin
Pete O'Hanlon5-Dec-09 8:50
mvePete O'Hanlon5-Dec-09 8:50 
AnswerRe: WinForms ListView Pin
Rama Krishna Vavilala5-Dec-09 1:35
Rama Krishna Vavilala5-Dec-09 1:35 
Questionmonitoring com port already open Pin
[masterman]4-Dec-09 8:13
[masterman]4-Dec-09 8:13 
QuestionComponentModel documentation [solved] Pin
vtchris-peterson4-Dec-09 5:04
vtchris-peterson4-Dec-09 5:04 
I'm trying to create a Component that sits in the Forms designer component tray and contains additional subcomponents that can be selected and configured via the document outline view (or through a collection property of the main component).

I've looked at numerous code project articles and even peeking at some MS components that behave kind of like this (e.g. ListView), but I can't seem to get my sub-components to show up in the Document Outline.

The MSDN is non-helpful in this area, their "documentation" consists of is a 2 sentence blurb describing an esoteric example and then 10 pages of code that assumes an intimate understanding of the entire .NET component model.

Anyone know of a good source of documentation on this area, or better yet any tips on what I might try?

Thanks,
-Chris

[solved]
I figured out how to do it. In my main component, add a custom designer:

[Designer(typeof(MyDesigner), typeof(IDesigner))]
public class MyComponent : Component


Then in MyDesigner, inherit from System.ComponentModel.Design.ComponentDesigner and override a couple methods, shown below:
public override void Initialize(IComponent component)
{
   base.Initialize(component);

   _myComponent = (MyComponent) component;
}

public override System.Collections.ICollection AssociatedComponents
{
   get
   {
      if (_myComponent == null)
      {
         return base.AssociatedComponents;
      }
      return _myComponent.Subcomponents;
   }
}


Now my sub components are selectable via Document Outline, but suppressed in the component tray (so as to keep it tidy). Cool | :cool:

modified on Friday, December 4, 2009 11:57 AM

QuestionDateTime in different cultures Pin
kKamel4-Dec-09 3:01
kKamel4-Dec-09 3:01 
AnswerRe: DateTime in different cultures Pin
dan!sh 4-Dec-09 3:11
professional dan!sh 4-Dec-09 3:11 
GeneralRe: DateTime in different cultures Pin
Luc Pattyn4-Dec-09 3:15
sitebuilderLuc Pattyn4-Dec-09 3:15 
GeneralRe: DateTime in different cultures Pin
dan!sh 4-Dec-09 3:20
professional dan!sh 4-Dec-09 3:20 
QuestionLinq and IEnumerable - case insensitive? Pin
shn40023-Dec-09 16:31
shn40023-Dec-09 16:31 
AnswerRe: Linq and IEnumerable - case insensitive? Pin
Luc Pattyn3-Dec-09 16:45
sitebuilderLuc Pattyn3-Dec-09 16:45 
GeneralRe: Linq and IEnumerable - case insensitive? Pin
Mark Salsbery3-Dec-09 19:27
Mark Salsbery3-Dec-09 19:27 
GeneralRe: Linq and IEnumerable - case insensitive? Pin
Pete O'Hanlon3-Dec-09 23:49
mvePete O'Hanlon3-Dec-09 23:49 
GeneralRe: Linq and IEnumerable - case insensitive? Pin
Luc Pattyn4-Dec-09 1:06
sitebuilderLuc Pattyn4-Dec-09 1:06 
AnswerRe: Linq and IEnumerable - case insensitive? Pin
N a v a n e e t h3-Dec-09 16:52
N a v a n e e t h3-Dec-09 16:52 
GeneralRe: Linq and IEnumerable - case insensitive? Pin
shn40023-Dec-09 17:23
shn40023-Dec-09 17:23 
QuestionProblem with List<> Pin
polomint3-Dec-09 7:40
polomint3-Dec-09 7:40 
AnswerRe: Problem with List<> Pin
vtchris-peterson3-Dec-09 7:57
vtchris-peterson3-Dec-09 7:57 
GeneralRe: Problem with List<> [modified] Pin
polomint3-Dec-09 7:59
polomint3-Dec-09 7:59 
AnswerRe: Problem with List<> Pin
puri keemti3-Dec-09 22:48
puri keemti3-Dec-09 22:48 
QuestionHold the parent session when calling a showModalDialog child Pin
Jose Alvarez de Lara3-Dec-09 4:37
Jose Alvarez de Lara3-Dec-09 4:37 
AnswerRe: Hold the parent session when calling a showModalDialog child Pin
puri keemti3-Dec-09 22:55
puri keemti3-Dec-09 22:55 

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.