PropertyGrid doesn't notice properties changed in code?

前端 未结 4 1027
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 08:18

I have a Winform application which uses colour to highlight certain things. I would like to allow the users to change \'their\' colours. As an exercise, I thought I would cr

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 08:40

    Happened across this Question in trying to remember what I used to use and thought it might be useful to others.

    You can use the [RefreshProperties] Attribute to trigger updates to the Property Grid.

    eg:

        [RefreshProperties(RefreshProperties.All)]
        public int MyProperty{ get; set; }
    

提交回复
热议问题