Click to See Complete Forum and Search --> : Setting rcBounds


Randy Dulaney
March 30th, 1999, 07:52 PM
I have written an ocx that just displays a bitmap, and changes this bitmap according to the setting of a property. The bitmap is representative of valve used in process control and is 16 by 16 pixels. The problem is, when the ocx is used in, say VB, upon clicking on the icon in the toolbox, the control places an image of the bitmap, oriented in the upper left hand of the rcBounds rectangle, where I want it, but the rcBounds area consists of a rectangle that is over 4 times the size of the bitmap and covers other controls in the surrounding area. Resizing the control to the bitmap dimensions cures the problem. Can I set the size of rcBounds to fit the bitmap? Any input is appreciated.

Lee Marmara
March 31st, 1999, 01:19 AM
Try using SetWindowPos on your control. Use GetBitmap to get the dimensions of the bitmap you are using.