Force Refresh / Repaint of Page Control in Design Mode (IDE) ??

P

philaphan80

Is there a way to force the Visual Studio IDE (Page Control at design-
time) to refresh / repaint itself upon drag & drop of *any* item from
the toolbox? Perhaps a method I need to override within the page
control?

I'm aware of using
"ComponentModel.RefreshProperties(RefreshProperties.All)" within
custom controls, but that only refreshes the page when something
specific to that custom control is changed. I'm looking for a way to
hook into the method(s) that add *any* new control -- custom or
standard (label, textbox, etc.) -- to the page so I can force a
refresh of the entire page *every time* a control is added. It would
also have to work when a control is renamed.

For example:

1. Drop custom validator control to page

2. Custom control has logic in overriden Render() method to check if
ControlToValidate control exists (e.g. "TextBox1"). If not, custom
control paints itself as an error message for quick visibility in IDE,
eliminating the need to build and debug before discovering the error.

3. Drop TextBox control to page (default name would be "TextBox1").
Custom control doesn't know to repaint itself, removing the error
message, even though ControlToValidate now exists. Page control needs
to somehow be told to repaint all controls when another is added or
renamed.

I hope this makes sense! Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top