Protection level (Modifiers) of controls change automaticlly in .Net

笑着哭i 提交于 2019-12-25 11:34:47

问题


My project is on .Net V2.0, some of controls are in public, when change form in design mode this controls changed to private. how can i fix this? thanks. When Modifier changed to private, in Property Tool Box Modifier property not show. many of controls go to below section of form in picture 2.


回答1:


I assume you are making the controls public by editing the Designer.cs file, there is a reason they put the warning in there that your changes will be lost.

The correct way is to mark the control's Modifers setting to public in design view from the properties menu for your control.


EDIT: Well I'll be damned, you don't have a modifiers option. Well, here is a workaround, create a property that is public that you control that can point at the private member.

public RadPageView pgvTabsPublic 
{
    get {return pgvTabs;}
}

Using this you can have other classes call yourForm.pgvTabsPublic and it will point them to the internal private pgvTabs member.




回答2:


This problem for Version of telerik i use, before i use version 2012 and now use 2013,fix it and work it, thanks



来源:https://stackoverflow.com/questions/17637366/protection-level-modifiers-of-controls-change-automaticlly-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!