Hi,

I started creating a new program in visual studio 2010 using C++ and windows form applications. However I done the bit of the design I got couple icons when you click on it opens a page and when I debug the program and resize the form those I icons are going weird and lagging and everything else its fine. It has nothing to with my computer cause I can run programs like Photoshop CS5 with a single lag. What would you suggest me to do?

I didn't write any code, basically I doing the design first and on windows form application I have this panel at top and I gave it a tile background and when I debug and resize the form and the panels background lags.

I didn't say code, I meant the project, as in zip it and post it. That seems the easiest way to help figure out why this is happening.

Meanwhile, some questions:

  • How big (dimensions) are the images you're using?
  • Have you tried running the application outside of Visual Studio?

It's a secret project, i can't send it sorry but the the background is tile and size of the tile is 10 X 10 and there a 6 images size of 24 X 24 so its really small indeed, i think its something to do with redraw idon't much about it but i heard that when u resize the form it redraws

It's a secret project, i can't send it sorry

Fair enough :)

i think its something to do with redraw idon't much about it but i heard that when u resize the form it redraws

I think you're on the right track there.

the background is tile and size of the tile is 10 X 10 and there a 6 images size of 24 X 24 so its really small indeed

Just to see what happens, try setting your background image layout to something other than "Tile". If that speeds it up, then drawing the tiled image is probably what's slowing it down.

Trying to tile such a small image actually might be the issue--if you need a faster tiled background, you might try tiling a larger image out of the small one in Photoshop first. That would reduce the number of background images the form is actually trying to draw.

Nope it doesn't it's even worst i tried tile, stretch, zoom, auto size all of them but making it bigger made it lag even more

Ack, sorry! :) Well, that's information, anyway. Does it run okay if you remove the background image?

Hm. Have you tried running your application on another computer?

It doesn't even lag a tiny bit. It's that little image. Do you think if i create the same image in visual studio would it stop lagging?

It doesn't even lag a tiny bit. It's that little image. Do you think if i create the same image in visual studio would it stop lagging?

Hm. I just created a small bitmap outside of VS and tiled it on a form... and there's no performance issue. Are you able to send the bitmap? I'd like to see if it does the same thing for me as it does for you.

The image I had doesn't lag any more i think it was a temporary issue it's fine now and the image i have is wmf it's a vector image.

I've never used a vector image as a form background; it might have to do with that. Anyway, I'm glad it's working now!

This article has been dead for over six months. Start a new discussion instead.