There are several other also better and flexible ways than #pragma region you can do to collapse code in VS:
Method 1: Use {...} instead which natively supports code collapsing in VS.
Enable option: Tools->Text Editor->C/C++->Formatting->OutLine Statement Blocks->True.
Put your in different scopes {...}, then it will collapse the code in different scopes:

Method 2: use keyboard shortcuts to collapse code you want:
CTRL + M + O will collapse all.
CTRL + M + L will expand all.
CTRL + M + P will expand all and disable outlining.
CTRL + M + M will collapse/expand the current section.
It is worthy noting that method #1 works better for plain code snippets. For functions, because similar to that we cannot have functions inside functions in C++, we cannot put functions in scope defined by {...}. Fortunately, we can still use method #1 for functions by creating namespaces for each scope. Or simply, use method #2.