开发者

CMFCPropertyGridProperty list of values?

开发者 https://www.devze.com 2023-04-10 15:34 出处:网络
Is there a standard way to hold a user editable list of values in a CMFCPropertyGridProperty?开发者_Python百科I\'m thinking a string with semi-colon delimiter (that seems to be the windows standard).I

Is there a standard way to hold a user editable list of values in a CMFCPropertyGridProperty?开发者_Python百科 I'm thinking a string with semi-colon delimiter (that seems to be the windows standard). If I want an edit interface for this how would I build that?


One option:

You can inherit CMFCPropertyGridProperty and override HasButton, returning TRUE. This will cause an ellipsis ("...") button to appear in the right-hand side of the value field. Override OnClickButton to provide your user interface for editing the list of values. You can pop up a dialog with a list control and a way to add/remove/edit items in the list. Override FormatProperty to display the list of values in the value field, and override ResetOriginalValue and implement code to restore the value you are constructed with.

Another option:

Inherit CMFCPropertyGridProperty and override OnKillFocus. If the user-entered value violates the formatting that you allow (semicolon-separated list of integers, for example), pop up a warning and return FALSE to prevent the edit from being committed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号