From: Karl Wochele on
Hi Kuno,

OpenDialog doesn't behave like a normal dialogwindow. You will have to
subclass Opendialog and use the following code:

CLASS MyOpenDialog INHERIT OpenDialog

METHOD dispatch(oEvent,hWnd) CLASS MyOpenDialog
LOCAL liRt AS LONGINT
LOCAL iX AS INT
LOCAL iY AS INT
LOCAL nW AS INT
LOCAL nH AS INT
LOCAL rcW IS _WINRect
LOCAL rcS IS _WINRect

liRt := SUPER:dispatch(oEvent)

IF oEvent:Message = WM_INITDIALOG

GetWindowRect(hWnd,@rcW)
nW := rcW.Right-rcW.Left
nH := rcW.Bottom-rcW.Top
SystemParametersInfo(SPI_GETWORKAREA,0,@rcS,0)

iX := Floor((rcS.Right-rcS.Left-nW)/2)
iY := Floor((rcS.Bottom-rcS.Top-nH)/2)

SetWindowPos( hWnd,;
HWND_TOP,;
iX,;
iY,;
0,;
0,;
SWP_NOSIZE)

ENDIF

RETURN liRt

HTH,
Karl


Kuno schrieb:
> Fred,
>
> Thank you for the code example. When I call it using:
>
> oOD := OpenDialog{SELF, "???inv.dbf"}
> oOD:Caption := "SELECT AN INVENTORY"
> oOD:SetStyle(OFN_HIDEREADONLY)
> fenZentrieren(oOD)
> oOD:Show()
>
>
> It generates an error at:
>
> nWeite := oWindow:size:width
>
> The error is no exported variable.
>
From: Kuno on
Got it. Thanks for the advice Karl and Geoff.

Kuno
First  |  Prev  | 
Pages: 1 2
Prev: Thanks and Happy New Year
Next: GZip compression