Freigeben über


TextSelection.ChangeCase Method

Changes the case of the text selection.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub ChangeCase ( _
    How As vsCaseOptions _
)
void ChangeCase(
    vsCaseOptions How
)
void ChangeCase(
    [InAttribute] vsCaseOptions How
)
abstract ChangeCase : 
        How:vsCaseOptions -> unit
function ChangeCase(
    How : vsCaseOptions
)

Parameters

Examples

Sub ChangeCaseExample()
   ' Open a document before running this example.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   objSel.StartOfDocument(True)
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
   objSel.ChangeCase(vsCaseOptions.vsCaseOptionsUppercase)
   MsgBox("Turned text uppercase.")
   objSel.CharLeft(False, 1)
   objSel.ChangeCase(vsCaseOptions.vsCaseOptionsLowercase)
   MsgBox("Turned text lowercase.")
End Sub

.NET Framework Security

See Also

Reference

TextSelection Interface

EnvDTE Namespace