C
codeslinger73
I ran into sort of a timing issue. I want to hold some default
properties for form controls (font, borderstyle, etc) in the registry
or a config file and then update these things after init but before the
paint. The problem is that the form's InitializeComponent() calls the
control's constructor and then updates the control's properties with
whatever it found during design time. So, i can change the properties
in the constructor of the control, but that gets buried right after.
I've tried overriding things like OnPaint and even using a message pump
to get to this right before the control is painted. One issue is that
in C# I wasn't able to get the timing right, another issue is that I
don't want this done more than once. The real goal is for this to be a
part of the control, which is in a library, and can be transparent to
any form that this gets dropped on.
Anyone else ever needed to do something like this?
Mark
properties for form controls (font, borderstyle, etc) in the registry
or a config file and then update these things after init but before the
paint. The problem is that the form's InitializeComponent() calls the
control's constructor and then updates the control's properties with
whatever it found during design time. So, i can change the properties
in the constructor of the control, but that gets buried right after.
I've tried overriding things like OnPaint and even using a message pump
to get to this right before the control is painted. One issue is that
in C# I wasn't able to get the timing right, another issue is that I
don't want this done more than once. The real goal is for this to be a
part of the control, which is in a library, and can be transparent to
any form that this gets dropped on.
Anyone else ever needed to do something like this?
Mark