Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redraw problem?

Status
Not open for further replies.

theweirdo

Programmer
Aug 7, 2002
17
CA
I have a user control embedded in an aspx page through the <object> tag. I want the size of this embedded object (or the size of the control) to change dynamically based on the data being loaded into the user control.

What I notice is this: the control doesn't seem to resize properly, but when I put a MessageBox.Show() into the code where the size is being recalculated, the resizing works better... does anyone know why this is and how I can fix it?

Thanks.
 
Never mind, I managed to figure out the problem.

My code did something like this:

for (int i=0; i<10; i++)
this.Height += i;

I changed so that it is like this:
int myHeight = somenumber;
for (int i=0; i<10; i++)
myHeight += i;
this.Height = myHeight;

And it works perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top