Created
April 9, 2024 20:10
-
-
Save bjoerntx/b75c178d0cf1bcaf1faf1196b40ae40d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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