Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created April 9, 2024 20:10
Show Gist options
  • Save bjoerntx/b75c178d0cf1bcaf1faf1196b40ae40d to your computer and use it in GitHub Desktop.
Save bjoerntx/b75c178d0cf1bcaf1faf1196b40ae40d to your computer and use it in GitHub Desktop.
public void ClearTableStyle(Table table, TextControl textControl)
{
var cellFormat = new TXTextControl.TableCellFormat();
// clear all row formats
foreach (TableRow row in table.Rows)
{
// apply each property of cellFormat to the row by using reflection
foreach (var property in cellFormat.GetType().GetProperties())
{
property.SetValue(row.CellFormat, property.GetValue(cellFormat));
}
}
table.Select();
textControl.Selection.ForeColor = Color.Black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment