Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do Delphi-like frames in C#?

Tags:

c#

frames

delphi

Slight bit of background: I'm a Delphi programmer re-learning C# (learned in school originally, haven't hardly touched until recently), and am trying to get some of my Delphi concepts transferred over.

The current situation is, I need to create an application that can use data from a variable list of similar data controls depending on location, need, etc. and in order to display that information in Delphi, I would simply use a scroll box and frames. The scroll box I can easily replace with the C# panel class, but I'm not finding anything I can use that will tell me how to create my frame class for use inside the panel. All I can find is some stuff for web development.

Can anyone point me in a good direction for learning the C# frame equivalent? Thanks.

EDIT:

For non-Delphi programmers, a frame is a form-like control that allows other controls (buttons, boxes, grids, etc) to be placed on it, then the frame gets used as a control itself on a form to reduce code-reuse as all frames do similar functionality and streamline development. For a (probably better) more in-depth description, see about.com's or Delphi Basics descriptions.

like image 838
Tom A Avatar asked Feb 26 '10 18:02

Tom A


4 Answers

EDIT:

For non-Delphi programmers, a frame is a form-like control that allows other controls (buttons, boxes, grids, etc) to be placed on it, then the frame gets used as a control itself on a form to reduce code-reuse as all frames do similar functionality and streamline development. For a (probably better) more in-depth description, see about.com's or Delphi Basics descriptions.

Sounds like a User Control to me.

Here are some tutorials:

WPF

WinForms

like image 172
Randolpho Avatar answered Nov 15 '22 11:11

Randolpho


Having used both Delphi and .Net, I think a UserControl is the equivalent. It's a container that you can add controls to, and then add to other forms in the project.

like image 22
Alan Clark Avatar answered Nov 15 '22 12:11

Alan Clark


You need to create a custom control that extends the Panel class and then repeat that custom control.

like image 5
Payton Byrd Avatar answered Nov 15 '22 12:11

Payton Byrd


I'm not familiar with Delphi, but what you describe sounds a bit like a WPF FlowDocument, or one of the related controls.

like image 1
Mark Seemann Avatar answered Nov 15 '22 12:11

Mark Seemann