Visual Studio Communit 2022, controls in designview

Olaf Jørgensen 0 Reputation points
2023-06-05T12:21:59.3433333+00:00

Hello, i am not sure if this is the right forum to ask, but here i go. Its about Visual Studio Design View i have previous VSC 2019 (few years ago) trying to learn C# but i do feel there are something different with VSC 2022 for example in the design View when i place a controller and i want to write some text after it, the text is written above or under it.
look at the files 1, 2 and 31.png2.png3.png

I am following a Udemy course where he is using 2017, there it works as i remember it from 2019.

Also when i push enter on the design view i get a <br>, i want to add a shortcut for paragraph, so when i push shift + enter i get a new paragraph.

I asked google bing about all of this but it dident understand or it just didnt work.

It told me to make a new shortcut Edit.InsertNewParagraph, but it would't let me assign it in VSC.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,871 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 29,351 Reputation points Microsoft Vendor
    2023-06-09T09:49:13.53+00:00

    Hi @Olaf Jørgensen,

    Thanks for your reply.

    For the first issue, you may check this option, in Visual Studio 2022, Tools > Options > Web Forms Designer > CSS Styling > change positioning to absolute for controls added using Toolbox, paste or drag and drop.

    If this option is checked, when you drag and drop a new control from Toolbox to Designer, the control can be dragged and moved again which means you may see a control(text) above/under another control(text). If you uncheck that option, when you drag and drop a new control to Designer, their position will change to absolute.

    User's image

    For the second issue, based on my test, if you push Enter on the design view but in/between, for example, <div></div> you will get a <br />. If you push Enter in <body></body> but not in sub elements, you may get <p>   </p>.

    User's image

    User's image

    You may try to focus the cursor out of the sub elements and push Enter to get a new paragraph.

    BTW, Edit.InsertNewParagraph is not an existing command(shortcut) in VS 2022 for assigning. You can check the available commands in Tools > Options > Environment > Keyboard.

    Feel free contact us.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.