Monday, June 30, 2014

Why doesn't this conversion work?

Safe way to handle this is


RichTextBox rtbControl = tabControl1.SelectedTab.Controls[0] as RichTextBox

if ( rtbControl != null )
{
rtbControl.AppendText(tabSpace);
}



If this helps, mark it as an answer or vote it.

It’s not safe enought . What if SelectedTab is null or Controls is empty?



No comments:

Post a Comment