views:

69

answers:

2

Heya Guys

im currently working on a project that involves listing contacts with a photo and email address, kind of like messengers contact lists.

The problem is ListView just dont cut it!

I need something that's like the MSN Live Messenger contact lists, Witch consist of a large padded area with photo(32px), And text to the right of the photo but also have the expandable headers.

Anybody give me some advice on any references i can use or if its possible to do with Tree-view can someone show me an example.

Kind Regards.

A: 

Are you using WPF? You could use a ListView after all with an Expander for the ItemTemplate. Blacklight also has a great AnimatedExpander: see Blacklight releases.

Hope that helps!

Kieren Johnstone
using Windows Forms. Im not confident enough in WPF atm, and this project has a deadline so went down he fastest route.
RobertPitt
Ah nevermind. WPF is great for things like this; you can put buttons in buttons, Expanders in TreeViews, rotating 3d cubes with textboxes in comboboxes.. well, you get the idea.
Kieren Johnstone
I went with `Brian R. Bondy` Answer on using Hybrid Integration. Thanks for your help anyway.
RobertPitt
+1  A: 

I would recommend making a WPF user control and hosting it in in an ElementHost control in your Windows Forms project. I've used WPF inside WinForms in the past and it works great.

Assuming you add an element host control onto your WinForms called elementHost1:

        elementHost1.Child = new MyWPFControl();
Brian R. Bondy
the problem is the project is already 40% completed and im not as confident in WPF as i have not studied it as much, I really wish i could use WPF but as the project is undergoing we dont ahve time to switch now.
RobertPitt
@RobertPitt: You are misinterpreting my answer, I'm not suggesting to switch. You wouldn't be switching nor redoing any of your old code. The only thing that would be done in WPF is a single user control. You would still have a Winforms project, it just happens to host a single WPF user control via an ElementHost element.
Brian R. Bondy
Ahh ok, Im with you now. Is there any chance you can supply an example on how to add a ListView to the Element host i just created?
RobertPitt
@RobertPitt: See edit
Brian R. Bondy
Ok thanks for your help, I'v added the needed references, Added the object initiation to the design, The `ListView()` is now attached to my `Elementhost`, Whenever I try to "Edit Hosted Element" it says that `Cannot find child item in the solution`.. Any ideas :)
RobertPitt
not sure but I don't think it's related to the element host at all. I recommend btw doing a wpf user control which contains your tree view.
Brian R. Bondy
Thanks so much, I now have my hybrid application, After some research i got it to work nicley :)
RobertPitt
Great! Congrats :) WPF controls are much easier for this type of thing.
Brian R. Bondy
Yes, I agree, I just have to now learn the tasks needed to do the design :), Thanks again
RobertPitt