你好,這是我的第一個堆棧溢出問題,所以請原諒我,如果我做任何愚蠢的事情。 那麼我的問題是,我正在關卡編輯器上工作,我想使用PropertyGrid控件來編輯瓷磚/實體等屬性。所以一切正常,值顯示正確,更新時更改槽代碼,但問題我expierencing是我不能改變值,除非它是一個布爾值,我GOOGLE了很多,但我只是找不到解決方案。Winforms PropertyGrid - 屬性不可編輯
這裏是代碼,我定義的屬性:
[Description("Defines the Position on the screen")]
public Vector2 screenpos { get; set; }
Vector2 WorldPos;
[Description("Defines the texture of the selected tile")]
public string texture { get; set; }
[Description("Defines if the player can collide with this tile")]
public bool IsCollidable { get; set; }
[Description("Defines on what layer this tile is drawn (1-3)")]
public int Layer { get; set; }
[Description("Shows if the tile is currently visible on the screen")]
public bool OnScreen { get; private set; }
我可以編輯IsCollidable,如果我從屏幕上的集中刪除私人我可以編輯太多,但我不能編輯別的,噢,我會appriciate如果你可以說你的答案有點簡單我沒有那麼多expierenced程序員,在此先感謝。
我看到他們像一個普通的屬性網格,不灰掉任何東西,我可以移動文本光標和東西,但如果我鍵入(字母或數字)沒有任何反應。 – 2010-11-03 13:51:46