+1  A: 

I don't know how your class structure is, but that empty space looks to be about what the other controls make up. Perhaps somewhere a movie isn't being found, and thus isn't showing anything?

nasufara
That's the thing Dark, all of the movies shown in the pics, are movies I've searched for to illustrate this problem and they ARE found. I don't understand why the blank space. Maybe it has something to do with the heigh of the panel and when the content exceeds X height? Am I missing something?
Sergio Tapia
+1  A: 

ok, the problem appears when the AutoScroll property of panel is set to true and the scroll bar is not at its initial position:0. The panel is positionning the controls at ypos + vertical position of scroll bar!!

Either set AutoScroll = false; before adding MovieItem then true; after, but this will reset the scroll bar position
or, substract the scroll bar position from ypos when setting the location.

Both fix the problem but the 2nd is better (no scroll bar reset):

public void X()
{
    int vscrollPos = panel1.VerticalScroll.Value;   

    MovieItem NewMovie = new MovieItem();
    NewMovie.SearchMovie(txtSearch.Text);
    NewMovie.Location = new Point(0, ypos - vscrollPos);
    ypos += 196;

    panel1.Controls.Add(NewMovie);
}
najmeddine
I've tried this, but the problem persists. I dont' know what could be the problem.
Sergio Tapia
Sorry. When I tested, I haven't scrolled the panel, and when I did that the problem was always there. After some digging with Reflector, I think I found a solution. See my edit.
najmeddine
Thanks a MILLION for this answer! How did you figure this out btw?
Sergio Tapia
I checked the `Class Panel` whith `Reflector` and saw that `PerformLayout()` and/or `OnLayout` methods take into account the value of AutoScroll when proceeding, I stopped there and begin playing with AutoScroll and observing different behaviors which led me to the solution above. That's all.
najmeddine