propertyGrid 屬性排序如何不為按照字母排序,就按照我自己寫的排序呢?
CProperty spT0 = new CProperty("環境溫度(K)", 298);
spT0.Category = "環境";
CProperty spP0 = new CProperty("環境壓力(Pa)", 100000);
spP0.Category = "環境";
CProperty spPint = new CProperty("管道的最初的壓力(Pa)", 4200000);
spPint.Category = "管道";
CProperty spUw = new CProperty("風速(m/s)", 2);
spUw.Category = "環境";
CProperty spQor = new CProperty("洩漏速率(kg/s)", 0.46);
spQor.Category = "管道";
CProperty spThetaj = new CProperty("洩漏孔軸線與水平面之間的垂直夾角(°)", 85);
spThetaj.Category = "計算參數";
CProperty spThetajv = new CProperty("孔口軸線與水平面在風速方向之間的夾角(°)", 0);
spThetajv.Category = "計算參數";
CProperty spX = new CProperty("觀測點到噴射孔的水平距離(m)", 150);
spX.Category = "計算參數";
CProperty spXpicker = new CProperty("距離間隔(m)", 3);
spXpicker.Category = "計算參數";
CProperty spPw = new CProperty("環境溫度下水的分壓力(Pa)", 1705);
spPw.Category = "環境";
CPropertyCollection spCollection = new CPropertyCollection();
spCollection.Add(spT0);
spCollection.Add(spP0);
spCollection.Add(spPint);
spCollection.Add(spUw);
spCollection.Add(spQor);
spCollection.Add(spThetaj);
spCollection.Add(spThetajv);
spCollection.Add(spX);
spCollection.Add(spPw);
spCollection.Add(spXpicker);
pgcJetFire.SelectedObject = spCollection;
propertyGrid是自動排序的,不過你可以給不同的屬性添加catalog,這樣用分類方式查看,就容易找了。