Diretiva #Region

Collapses and hides sections of code in Visual Basic files.

#Region "identifier_string"
#End Region

Parts

Term

Definition

identifier_string

Required. String that acts as the title of a region when it is collapsed. Regions are collapsed by default.

#End Region

Terminates the #Region block.

Comentários

Use o #Region a diretiva para especificar um bloco de código para expandir ou recolher ao usar o recurso de estrutura de tópicos do Editor deCódigo de Visual Studio. #Regioninstruções de suportam a semântica de bloco (como #If...#End If), significado que o início e fim devem estar no mesmo bloco de código. You can place, or nest, regions within other regions to group similar regions together.

Exemplo

This example uses the #Region directive.

#Region "MathFunctions"
    ' Insert code for the Math functions here.
#End Region

Consulte também

Tarefas

Como: Estrutura de tópicos e ocultar código

Como: Recolher e ocultar seções de código (Visual Basic)

Referência

Diretivas #If...Then...#Else