Cntrol Creation

  • Thread starter Thread starter Vivek
  • Start date Start date
V

Vivek

Hello.. I want to create a control that resembles the "Properties"
window in Visual Studio. What is the best control I can use for that ?
I am using .NET 1.1 and winforms. Any help would be appreciated.
Thanks in advance.
 
Vivek said:
Hello.. I want to create a control that resembles the "Properties"
window in Visual Studio. What is the best control I can use for that ?
I am using .NET 1.1 and winforms.

Use a System.Windows.Forms.PropertyGrid control. This looks exactly the
same as the Properties window (and has the same capabilities) and is very
easy to use: just assign to the property SelectedObject a reference to the
object whose properties you want to show, and they appear in the control.
You can decorate with attributes the properties in your object to control
the way that they are displayed in the PropertyGrid.
 
Thank you very much for your reply. My requirement is I need to have a
control with three columns, where the first column is a CheckBox,
second is normal column and third is a column which will have controls
based on the value in the second column
eg: chekbox Question1 CheckBox
checkbox Question2 TextBox
checkbox Question3 ComboBox
and so on... Can I create controls inside a ListBox or a ListView? How
can I do it..? Thanks in advance....
 
Vivek said:
Thank you very much for your reply. My requirement is I need to have a
control with three columns, where the first column is a CheckBox,
second is normal column and third is a column which will have controls
based on the value in the second column
eg: chekbox Question1 CheckBox
checkbox Question2 TextBox
checkbox Question3 ComboBox
and so on... Can I create controls inside a ListBox or a ListView? How
can I do it..? Thanks in advance....

Ah, no, you can't the PropertyGrid for this purpose. It always displays
two columns, and the first one is always the name of each property.

If I have understood what you are describing, I think that a DataGrid
control would be the best for you, but you will have to do quite a bit of
work to sublass the DataGridColumnStyle for the third column, which needs to
host different controls depending on the value of another column.
 
Back
Top