MFCDialogStringVariableExtender.MaxChars 属性

定义

获取或设置由父对象表示的字符串类型变量的最大字符数。

public:
 property System::String ^ MaxChars { System::String ^ get(); void set(System::String ^ value); };
public:
 property Platform::String ^ MaxChars { Platform::String ^ get(); void set(Platform::String ^ value); };
[System.Runtime.InteropServices.DispId(1)]
public string MaxChars { [System.Runtime.InteropServices.DispId(1)] get; [System.Runtime.InteropServices.DispId(1)] set; }
[<System.Runtime.InteropServices.DispId(1)>]
[<get: System.Runtime.InteropServices.DispId(1)>]
[<set: System.Runtime.InteropServices.DispId(1)>]
member this.MaxChars : string with get, set
Public Property MaxChars As String

属性值

String

一个表示最大字符数的字符串。

属性

示例

此示例显示由类实现的第一个对话框变量的最大字符范围 CAboutDlg

Sub GetMaxChars()  
    Dim vcCM as VCCodeModel  
    Dim vcClass as VCCodeClass  
    Dim mfcVar as VCCodeVariable  
    vcCM = DTE.Solution.Item(1).CodeModel  
    vcClass = vcCM.Classes.Find("CAboutDlg")  
    vcVar = vcCM.Variables.Item(1)  
    MsgBox(vcVar.Extender("MFCDialogStringVariable").MaxChars)  
End Sub  

有关如何编译和运行此示例的信息,请参阅 如何:编译 Visual C++ 代码模型扩展性的示例代码

注解

MFCDialogStringVariableExtender对象表示字符串类型对话框变量的验证范围。

适用于