Click here to Skip to main content
13,089,536 members (71,859 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 1: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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2017
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