View2.Name 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取视图的名称。
public:
property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String
属性值
视图的名称。
实现
示例
在以下示例中,对象的 Name 属性 ViewObject 用于确定用户切换到的视图。 如果该视图为“存档客户”视图,则将注释值添加到表单的基础 XML 文档:
if (thisXDocument.View.<span class="label">Name</span> == @"Archive Customer")
{
IXMLDOMNode notes = thisXDocument.DOM.selectSingleNode(
@"/Customers/CustomerInfo/Notes");
IXMLDOMNode div = thisXDocument.DOM.createNode(
1, "div", @"http://www.w3.org/1999/xhtml");
div.text = "Note recorded " +
thisXDocument.Util.Date.Now().ToString();
notes.appendChild(div);
}
注解
若要确定默认视图, IsDefault 请使用 对象的 属性 ViewInfoObject 。
重要提示:此成员只能由与当前打开的窗体在同一域中运行的表单访问,或者由已授予跨域权限的表单访问。