i get some HTML returned from an external source and set to a simple string. However when i set the DocumentText param of the control nothing gets changed. This seems to be a common issue, and ive tried the results from previous posts to no avail.
Also the .show() method doesnt seem to pop the window up? In the code below it creates a new window, sets some params and tried to open the browser.
private void createWindow(String text)
{
if (text == null) throw new ArgumentNullException("Nothing has been returned, possible MBean Failure");
Window a = new Window();
a.Title = "Output";
RichTextBox rtb = new RichTextBox();
rtb.FontSize = 12;
rtb.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#639FBE"));
rtb.IsReadOnly = true;
rtb.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
rtb.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
rtb.Margin = new Thickness(15);
Grid myGrid = new Grid();
a.Content = myGrid;
myGrid.Children.Add(rtb);
rtb.AppendText(text);
a.Height = myGrid.Height;
a.Width = myGrid.Width;
if (text == null) throw new ArgumentNullException("Nothing has been returned, possible Failure");
browser.Navigate("abount:blank");
HtmlDocument doc = browser.Document;
browser.Document.OpenNew(true);
doc.Write("<HTML>" + text + "</HTML>");
browser.DocumentText = doc.ToString();
browser.Show();
// a.ShowDialog();
}
<body>tags aren’t optional