c# - What event occurs immediately after a control is displayed for the first time? -
i know there usercontrol.load, occurs before control becomes visible first time. , know there usercontrol.handlecreated, occurs when handle created control.
but i'm looking event occurs when control shown first time.
reason:
i dealing datagridview has bunch of data put before control shown. can't color rows (backcolor) without control being painted (the commands don't work). commands color rows works once control has been painted first time. need capture event , colorize rows @ point.
datagridview1.rows[index].defaultcellstyle.backcolor = color.red; the above line works when control shown not work control not shown.
you can use visiblechanged event.
private void usercontrol_visiblechanged(object sender, eventargs e) { if (this.visible) { ... } else { ... } }
Comments
Post a Comment