Muhammad Ali

Muhammad Ali

  • NA
  • 47
  • 22.5k

Displaying Lines in separate message boxes

Oct 2 2017 1:22 PM
Hello everyone,
 
I am working on a UWP app. It consists of  a multiline textbox. I want to display each of the line in a separate message box. I have tried the below code:
 
String[] lines = textBox.Text.Split(new char[] {'\n' }, StringSplitOptions.None);
foreach (string l in lines)
{
Windows.UI.Popups.MessageDialog dlg = new
Windows.UI.Popups.MessageDialog(l);
await dlg.ShowAsync();
}
 
But it is showing all the lines in a single texbox. And I also found that the Textbox.Lines property does not work in UWP. So kindly help me as how can I display each line in a Separate MessageBox.
 Thanks. 

Answers (1)