
Picturebox Height property is not an integer as claimed
Don,
About the picture box bug: 36464 can't be truncated to 32767, primarily because 36,464 is a smaller number than 32,767. It will, however, be chopped if the value is greater than 32767, because (I don't no this for a fact) internally it might still be running off the COM/ActiveX PictureBox. The Height property *is* an integer value, the problem is in what ever the .NET object is wrapping. But this isn't the point...
Why are you resizing the picture box to such massive sizes?! If you want to buffer the image data, store it in memory in a BitMap object, don't use the Picture property of a picture box. If this is because your trying to scroll the thumbnails, you can still use a memory bmp, just blit it onto the surface where you want it to appear and use height/width of the picture box as the size.
In my opinion, you should never use controls as a short cut to coding highly graphical interfaces. It will have bugs every time.
Jeremy
Quote:
> I have a VB.NET application that resizes a Picturebox control to fit a
> specified number of thumbnail images. It worked fine for small numbers of
> thumbnails, but truncated larger displays on the bottom (190 rows of
> thumbnails).
> After some debugging, I found that the reason was that the Height property
> of the picture box was truncating a computed value of 36464 to 32767. As a
> test, I declared a variable to be Integer, and stored the exact same
> computed height value there. I got the correct value of 36464.
> The documentation claims that the Height property is an Integer, but my
> tests show that it is a Short (Int16) instead.
> Is there a workaround? Is this fixed in the upcoming version of Visual
> Studio?
> Don Peters