CompuServe Messages

#faster FRAME routine

    09-Oct-91 09:41:58
Sb: #faster FRAME routine
Fm: paul bonner 76000,13
To: Nelson Ford 71355,470
I liked the VBTIPS viewer so much I started playing around with its FRAME routine for a project of my own. I discovered you can speed up FORM.SHOW commands considerably by putting all the controls that you want to FRAME on top of a Frame control which is covered entirely by a Picture control, and then changing the form's PAINT routine to something like: IF PICTURE1.AUTODRAW=TRUE THEN EXIT SUB PICTURE1.AUTODRAW=TRUE CALL PicFrame(FORM.PictureControl, ControlToFrame) This ensures that the frame will be drawn only the first time that the form is displayed. On subsequent repainting of the form the already-drawn frame will be shown. The PicFrame routine differs from your FRAME routine only in that defines F AS CONTROL rather than F AS FORM in its parameter list. One caveat–listboxes don't seem to always refresh reliably using this method (AUTODRAW=TRUE). Thus it may be necessary to include a LISTOBOX.REFRESH command at the beginning of the FORM.PAINT statement. There are 2 Replies.