Click here to Skip to main content
11,922,416 members (30,439 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Windows
I have to create one custom control as like stack panel in wpf for win forms, where in that custom control if I add any control, it should be added.

Please give me suggestion.
Posted 1-Apr-13 2:13am
ThePhantomUpvoter 1-Apr-13 8:07am
A suggestion for what exactly? What is the problem?
Neelendu Kumar 1-Apr-13 8:34am
i want to create a custom control works as control container in win forms application
ThePhantomUpvoter 1-Apr-13 8:54am
And you have already said that. "I want" is not a question or a description of a problem. So again, what is the problem? Is the problem that you do not know C#? Can you create a custom control? You don't know what a stack panel is? Why don't you just use the WPF stack panel in your Winforms app instead of reinventing the wheel?
Neelendu Kumar 1-Apr-13 9:09am
i know c#..but in my project there is one requirement i have to create one custom control works as control container. for that i create one class inherit from control what to do i didn't understand that's why i posted question

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

So, basically, you want someone to teach you everythign there is to know about writing a custom control??

That's just not going ot happen in a forum environment. The amount of knowledge required is WAY TOO MUCH for a few forum posts.

You can start with this[^].

You better put this project on hold until you learn how to make custom controls first. Then you'll have to apply that knowledge to designing your control. Really, a stack panel is just a Controls collection that controls the positioning of the controls in its collection.

You're going to have a big problem though. Since controls in Windows Forms don't behave the same way the equivilent control in WPF do, don't expect to come up with the exact same behavior as the WPF StackPanel. You'd have to create an entire family of controls to duplicate that. But then, why would you when you can save yourself all of the work and just use WPF??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 453
1 Dave Kreskowiak 335
2 Sergey Alexandrovich Kryukov 263
3 Richard MacCutchan 225
4 ppolymorphe 175
0 OriginalGriff 7,231
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,356
3 George Jonsson 2,865
4 Suvendu Shekhar Giri 2,216

Advertise | Privacy | Mobile
Web03 | 2.8.151120.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100