Autor Beitrag
Macoy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Di 29.11.05 13:31 
Hallo,


Ich benutze ein PropertyGrid um die Properties meiner Objekte darzustellen.

Hier mal ne Skizze, wie das ungefähr aussieht mit meinem Properties:

ausblenden volle Höhe C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
public class Sample
{

//Hier eine ganz einfacher Datentyp
[CategoryAttribute("Name"),
CategoryDescription("Name of the Object")]
public string Name
{
get{return name;}
set{name=value;}
}

//Hier ein Color
[CategoryAttribute("Appereance"),
CategoryDescription("Color of the Object")]
public Color GeneralColor
{
get{return generalColor;}
set{generalColor=value;}
}

//Und hier schon mein Problem(chen) : 
[CategoryAttribute("Filename"),
CategoryDescription("Filename of the Object")]
public string FileName
{
get{return fileName;}
set{fileName=value;}
}

}


Wenn ich nun dieses Objekt mittels

ausblenden C#-Quelltext
1:
propertyGrid.SelectedObject = instance_of_sample;					


anzeigen lasse, erscheint für die Property Color automatisch ein Color-Chooser zum Anklicken.

Nun will ich für das FileName Property ebendfalls ein FileChooser zum Anklicken haben. Bevor ich da aber nun anfange, viel rumzubauen, wüsst ich gern, ob man da auch einfach einen bestimmten Datentyp (zb. File) nehmen kann sodas das PropertyGrid das automatisch macht.
Macoy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Di 29.11.05 13:57 
Titel: Problem gelöst
Hab das Problem gelöst.

Wer vor dem selben Problem steht, lese sich diese wirklich gute Seite durch:

www.joergmulthaup.de/faq_1.html
Robert_G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416


Delphi32 (D2005 PE); Chrome/C# (VS2003 E/A, VS2005)
BeitragVerfasst: Di 29.11.05 15:24 
hier wäre vllt auch noch was gewesen. ;)