Click here to Skip to main content
Rate this: bad
good
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.
Thanks
Posted 1-Apr-13 2:13am
v2
Comments
ThePhantomUpvoter at 1-Apr-13 8:07am
   
A suggestion for what exactly? What is the problem?
Neelendu Kumar at 1-Apr-13 8:34am
   
i want to create a custom control works as control container in win forms application
ThePhantomUpvoter at 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 at 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 class.now what to do i didn't understand that's why i posted question

1 solution

Rate this: bad
good
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??
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 255
3 Shweta N Mishra 216
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2014
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