Page 1 of 1

streching timage control in dialog

PostPosted: Wed Jan 25, 2006 4:13 pm
by reinaldocrespo
Hi.

I have a dialog from resources with a single control in it. It is an timage control:

DEFINE DIALOG oDlg NAME "ViewImage" TITLE "View scanned image dialog window" of oOwner

oImage := tImage():Redefine( 101,, ImgRoot + oLbx:aArrayData[ oLbx:nArrayAt, 5 ], oDlg,,, .t. )

The dialog is resizeable. I'd like for the timage control to resize when ever the container-dialog is resized.

Any ideas?

thank you,


Reinaldo Crespo-Bazán

PostPosted: Wed Jan 25, 2006 4:22 pm
by reinaldocrespo
I found this to work:


odlg:bResized := { ||ResizeImage( odlg, oImage ) }

...

Static function ResizeImage( odlg, oImage )
oImage:Move( 0,0, odlg:nWidth(), odlg:nHeight() )
oImage:refresh()
return nil

PostPosted: Wed Jan 25, 2006 4:40 pm
by James Bott
Reinaldo,

I'm curious, how do you make a dialog resizable?

James

PostPosted: Wed Jan 25, 2006 4:54 pm
by reinaldocrespo
I suppose that the properties defined on the resource editor.

On this particular dialog I have the following checked:

system menu
thick frame
maximize box
modal frame
visible

PostPosted: Wed Jan 25, 2006 4:54 pm
by reinaldocrespo
and window type popup.