XmlMappedRange.PrefixCharacter 属性

获取 XmlMappedRange 控件的前缀字符。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
ReadOnly Property PrefixCharacter As Object
    Get
Object PrefixCharacter { get; }

属性值

类型:System.Object
XmlMappedRange 控件的前缀字符。

备注

前缀作为字符串返回。 尝试将返回的对象强制转换为字符会导致无效强制转换异常。

如果 TransitionNavigKeys 属性为 false,则此前缀字符串对于文本标签为 ',或者为空白。 如果 TransitionNavigKeys 属性为 true,则此属性对于左对齐标签为 '、对于右对齐标签为 "、对于居中标签为 ^、对于重复标签为 \,或者为空白。

示例

下面的代码示例使用 PrefixCharacter 属性显示 XmlMappedRange 的前缀字符。 此代码示例假定当前工作表包含一个名为 CustomerLastNameCell 的 XmlMappedRange

Private Sub DisplayPrefixCharacter()
    If CStr(Me.CustomerLastNameCell.PrefixCharacter) = "" Then
        MsgBox("The prefix character is blank.")
    Else
        MsgBox("The prefix character is: " & _
            Me.CustomerLastNameCell.PrefixCharacter)
    End If
End Sub
private void DisplayPrefixCharacter()
{
    if ((string)this.CustomerLastNameCell.PrefixCharacter == "")
    {
        MessageBox.Show("The prefix character is blank.");
    }
    else
    {
        MessageBox.Show("The prefix character is: " +
            this.CustomerLastNameCell.PrefixCharacter);
    }
}

.NET Framework 安全性

请参见

参考

XmlMappedRange 接口

Microsoft.Office.Tools.Excel 命名空间