Skip to content

Commit 3c11684

Browse files
authored
Fixed regression in the processing of new lines within the InfoBox content (#59)
1 parent 8901bb9 commit 3c11684

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

InfoBox/Form/InformationBoxForm.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,17 +1270,16 @@ private void SetText()
12701270
Screen currentScreen = Screen.FromControl(this);
12711271
int screenWidth = currentScreen.WorkingArea.Width;
12721272

1273+
this.messageText.Text = this.messageText.Text.Replace("\r\n", "\n");
1274+
this.messageText.Text = this.messageText.Text.Replace("\n", Environment.NewLine);
1275+
12731276
if (this.autoSizeMode == InformationBoxAutoSizeMode.FitToText)
12741277
{
12751278
this.messageText.WordWrap = false;
12761279
this.messageText.Size = TextRenderer.MeasureText(this.messageText.Text, this.messageText.Font, currentScreen.WorkingArea.Size, TextFormatFlags.TextBoxControl) + new Size(1, 1);
12771280
}
12781281
else
12791282
{
1280-
this.messageText.Text = this.messageText.Text.Replace("\r\n", "\n");
1281-
this.messageText.Text = this.messageText.Text.Replace("\n", Environment.NewLine);
1282-
1283-
12841283
if (this.autoSizeMode == InformationBoxAutoSizeMode.None)
12851284
{
12861285
this.messageText.WordWrap = true;

0 commit comments

Comments
 (0)