admin管理员组

文章数量:1400599

I have a problem, I can't seem to find the solution to automatically save the window layout in Visual Studio. I wanted to always make the document be split vertically in all instances. Meaning, if I open Document2, it should already be split vertically. I also wanted to save the window size and layout from Document1 so I can apply it in Document2. The Save Window Layout feature doesn't seem to solve this problem, it only saves "what" the windows are, not how they are placed.

This is how it looks like if I split window vertically:

This is how it looks like if I create a new file/document:

I have a problem, I can't seem to find the solution to automatically save the window layout in Visual Studio. I wanted to always make the document be split vertically in all instances. Meaning, if I open Document2, it should already be split vertically. I also wanted to save the window size and layout from Document1 so I can apply it in Document2. The Save Window Layout feature doesn't seem to solve this problem, it only saves "what" the windows are, not how they are placed.

This is how it looks like if I split window vertically:

This is how it looks like if I create a new file/document:

Share Improve this question edited Mar 24 at 8:44 ASh 35.7k9 gold badges65 silver badges87 bronze badges asked Mar 24 at 3:01 Keane LedesmaKeane Ledesma 31 bronze badge 3
  • Hi Keane Ledesma, Have you checked shingo's solution? After my test, it could successfully set the XAML Designer to a vertical split layout. More description: 1. Located at the top of Visual Studio 2022, you could set the vertical split layout through Tools->Options...->XAML Designer -> Split Orientation. It is effective when a new window is created and opened. 2. To make all effective, you need to delete the .suo file, which is located in .vs/<ver>/.suo under the current solution. Mine is located in .vs/{solution name}/v17/.suo under the current solution. – HongRui Yu Commented Mar 26 at 1:23
  • thank you! but what about the resizing? say i moved the live preview a bit to the left to show more code. i would like the exact same layout to be used if i create another file. – Keane Ledesma Commented Mar 27 at 2:09
  • Hi Keane Ledesma, After investigation, it is found that the overall layout of Visual Studio 2022 could only be saved through Window->Save Window Layout. There is still no corresponding solution for saving the refined layout in XAML Designer. – HongRui Yu Commented Mar 27 at 9:11
Add a comment  | 

1 Answer 1

Reset to default 0

The relevant option is XAML Designer > Split Orientation. But for the already opened XAML files, their layout configurations are saved in the .vs/<ver>/.suo file, and you may need to delete it.

本文标签: wpfHow to automatically split window vertically in Visual StudioStack Overflow