{"id":6598,"date":"2025-05-01T10:41:10","date_gmt":"2025-05-01T08:41:10","guid":{"rendered":"https:\/\/ekiwi.de\/index.php\/6598\/visual-studio-line-break-in-resource-file\/"},"modified":"2025-05-01T10:46:33","modified_gmt":"2025-05-01T08:46:33","slug":"visual-studio-line-break-in-resource-file","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/en\/index.php\/6598\/visual-studio-line-break-in-resource-file\/","title":{"rendered":"Visual Studio line break in resource file"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi.de\/en\/index.php\/6598\/visual-studio-line-break-in-resource-file\/#What_does_not_work\" >What does not work<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi.de\/en\/index.php\/6598\/visual-studio-line-break-in-resource-file\/#How_it_works\" >How it works<\/a><\/li><\/ul><\/nav><\/div>\n<p>Anyone programming in <a href=\"https:\/\/visualstudio.microsoft.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Visual-Studio<\/em><\/a> is likely to use a resource file to manage texts\/strings and output them in several languages, for example for label texts or as a warning message (<em>MessageBox<\/em>). The text\/string can then be written one after the other in the <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/introducing-the-revamped-visual-studio-resource-explorer\/\" target=\"_blank\" rel=\"noopener noreferrer\">resource editor<\/a>. But sometimes you need a line break so that the text is structured and clearly displayed, as in the following warning message.<\/p>\n<figure id=\"attachment_6594\" aria-describedby=\"caption-attachment-6594\" style=\"width: 409px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6594\" src=\"\/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-line-break-1.jpg\" alt=\"Warning message programmed with Visual Studio and resource file\/resource editor, which contains several line breaks\" width=\"409\" height=\"237\" srcset=\"\/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-line-break-1.jpg 409w, \/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-line-break-1-300x174.jpg 300w\" sizes=\"auto, (max-width: 409px) 100vw, 409px\" \/><figcaption id=\"caption-attachment-6594\" class=\"wp-caption-text\">Line breaks of a MessageBox with string from resource file<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"What_does_not_work\"><\/span>What does not work<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>What does not work in this case is if you insert the characters for <em>line feed<\/em> (<code>\\r<\/code>) and <em>line break<\/em> (<code>\\n<\/code>), i.e. <code>\"\\n\\r\"<\/code>, as with strings. These characters are then displayed in the same way.<\/p>\n<p>What also does not work is that you simply use the key combination <em>&#8220;Alt+Enter&#8221;<\/em> or <em>&#8220;Alt+Return&#8221;<\/em> as in Excel if you need a line break within a cell.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_it_works\"><\/span>How it works<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In the Visual Studio resource editor cell, however, you can simply use the key combination <em>&#8220;Shift+Enter&#8221;<\/em> or <em>&#8220;Shift+Return&#8221;<\/em> to insert one or more line breaks.<\/p>\n<p>It will then be displayed in the resource editor as follows<\/p>\n<figure id=\"attachment_6596\" aria-describedby=\"caption-attachment-6596\" style=\"width: 833px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6596\" src=\"\/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-insert-line-break.jpg\" alt=\"Screenshot of how to insert a line break in text or string in the Visual Studio resource editor\" width=\"833\" height=\"414\" srcset=\"\/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-insert-line-break.jpg 833w, \/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-insert-line-break-300x149.jpg 300w, \/wp-content\/uploads\/2025\/05\/visual-studio-screenshot-resource-file-insert-line-break-768x382.jpg 768w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><figcaption id=\"caption-attachment-6596\" class=\"wp-caption-text\">Texts with line breaks in the Visual Studio resource editor<\/figcaption><\/figure>\n<p>More interesting articles about Visual Studio:<\/p>\n<ul>\n<li><a href=\"https:\/\/ekiwi.de\/en\/index.php\/4825\/change-visual-studio-language\/\">How to change the language settings in VisualStudio<\/a><\/li>\n<li><a href=\"https:\/\/ekiwi.de\/en\/index.php\/5167\/visual-studio-create-method-from-selected-code-lines-refactoringredesign\/\">Refactoring: Create\/extract method from code<\/a><\/li>\n<li><a href=\"https:\/\/ekiwi.de\/en\/index.php\/4793\/visual-studio-referenced-component-could-not-be-found\/\">The referenced component &#8216;[&#8230;]&#8217; could not be found<\/a><\/li>\n<\/ul>\n\n<div class=\"aawp\">\n\n            \n            \n<div class=\"aawp-product aawp-product--horizontal aawp-product--bestseller aawp-product--ribbon\"  data-aawp-product-asin=\"3367108499\" data-aawp-product-id=\"5245\" data-aawp-tracking-id=\"ekiwide0b-21\" data-aawp-product-title=\"Einstieg in C# mit Visual Studio 2026  Ideal f\u00fcr Programmieranf\u00e4nger\">\n\n    <span class=\"aawp-product__ribbon aawp-product__ribbon--bestseller\">Bestseller No. 1<\/span>\n    <div class=\"aawp-product__thumb\">\n        <a class=\"aawp-product__image-link\"\n           href=\"https:\/\/www.amazon.de\/dp\/3367108499?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=book%20visual%20studio\" title=\"Einstieg in C# mit Visual Studio 2026: Ideal f\u00fcr Programmieranf\u00e4nger\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            <img decoding=\"async\" class=\"aawp-product__image\" src=\"https:\/\/m.media-amazon.com\/images\/I\/512l59ygKgL._SL160_.jpg\" alt=\"Einstieg in C# mit Visual Studio 2026: Ideal f\u00fcr Programmieranf\u00e4nger\"  \/>\n        <\/a>\n\n            <\/div>\n\n    <div class=\"aawp-product__content\">\n        <a class=\"aawp-product__title\" href=\"https:\/\/www.amazon.de\/dp\/3367108499?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=book%20visual%20studio\" title=\"Einstieg in C# mit Visual Studio 2026: Ideal f\u00fcr Programmieranf\u00e4nger\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            Einstieg in C# mit Visual Studio 2026: Ideal f\u00fcr Programmieranf\u00e4nger        <\/a>\n        <div class=\"aawp-product__description\">\n            <ul><li>Theis, Thomas (Author)<\/li><\/ul>        <\/div>\n    <\/div>\n\n    <div class=\"aawp-product__footer\">\n\n        <div class=\"aawp-product__pricing\">\n            \n                            <span class=\"aawp-product__price aawp-product__price--current\"><\/span>\n            \n                    <\/div>\n\n                <a class=\"aawp-button aawp-button--buy aawp-button--icon aawp-button--icon-black\" href=\"https:\/\/www.amazon.de\/dp\/3367108499?tag=ekiwide0b-21&#038;linkCode=ogi&#038;th=1&#038;psc=1&#038;keywords=book%20visual%20studio\" title=\"Buy on Amazon\" target=\"_blank\" rel=\"nofollow noopener sponsored\">Buy on Amazon<\/a>\n            <\/div>\n\n<\/div>\n\n            \n            \n<div class=\"aawp-product aawp-product--horizontal aawp-product--bestseller aawp-product--ribbon\"  data-aawp-product-asin=\"1933492953\" data-aawp-product-id=\"5268\" data-aawp-tracking-id=\"ekiwide0b-21\" data-aawp-product-title=\"Framed Ink  Drawing and Composition for Visual Storytellers\">\n\n    <span class=\"aawp-product__ribbon aawp-product__ribbon--bestseller\">Bestseller No. 2<\/span>\n    <div class=\"aawp-product__thumb\">\n        <a class=\"aawp-product__image-link\"\n           href=\"https:\/\/www.amazon.de\/dp\/1933492953?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=book%20visual%20studio\" title=\"Framed Ink: Drawing and Composition for Visual Storytellers\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            <img decoding=\"async\" class=\"aawp-product__image\" src=\"https:\/\/m.media-amazon.com\/images\/I\/41Nbo1hDUAS._SL160_.jpg\" alt=\"Framed Ink: Drawing and Composition for Visual Storytellers\"  \/>\n        <\/a>\n\n            <\/div>\n\n    <div class=\"aawp-product__content\">\n        <a class=\"aawp-product__title\" href=\"https:\/\/www.amazon.de\/dp\/1933492953?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=book%20visual%20studio\" title=\"Framed Ink: Drawing and Composition for Visual Storytellers\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            Framed Ink: Drawing and Composition for Visual Storytellers        <\/a>\n        <div class=\"aawp-product__description\">\n            <ul><li>Design Studio Press<\/li><li>Mateu-mestre, Marcos (Author)<\/li><\/ul>        <\/div>\n    <\/div>\n\n    <div class=\"aawp-product__footer\">\n\n        <div class=\"aawp-product__pricing\">\n            \n                            <span class=\"aawp-product__price aawp-product__price--current\"><\/span>\n            \n                    <\/div>\n\n                <a class=\"aawp-button aawp-button--buy aawp-button--icon aawp-button--icon-black\" href=\"https:\/\/www.amazon.de\/dp\/1933492953?tag=ekiwide0b-21&#038;linkCode=ogi&#038;th=1&#038;psc=1&#038;keywords=book%20visual%20studio\" title=\"Buy on Amazon\" target=\"_blank\" rel=\"nofollow noopener sponsored\">Buy on Amazon<\/a>\n            <\/div>\n\n<\/div>\n\n    \n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to insert a line break in Visual Studio Resource Editor and which keyboard shortcut to use.<\/p>\n","protected":false},"author":2,"featured_media":5726,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[870],"tags":[872,876,1321,875],"class_list":["post-6598","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-c-en","tag-programming-en","tag-vba","tag-visual-studio-en"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/posts\/6598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/comments?post=6598"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/posts\/6598\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/media\/5726"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/media?parent=6598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/categories?post=6598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/tags?post=6598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}