次の方法で共有


MFCDialogStringVariableExtender.MaxChars Property

Definition

Gets or sets the maximum characters for the string-type variable represented by the parent object.

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

Property Value

A string representing the maximum number of characters.

Attributes

Examples

This example displays the maximum character range of the first dialog box variable, implemented by the CAboutDlg class.

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  

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

Remarks

The MFCDialogStringVariableExtender object represents the validation range of a string-type dialog box variable.

Applies to