Somebody replied to my request about resizing a form to fit the
displayed table in PdoxWin.
Unfortunately an accident killed the mail packet before I could reply.
Whoever, thanks for your comments. You mentioned setting the Size To Fit
Property, and some other stuff - I think I tried that (I tried a heap of
stuff :-() and from memory it was OK going from the design to the view
data mode, but opening the form from scratch still left me with a big
form with the table in one corner.
Anyway, I solved the problem. Here's what I did...
This method is in the form:
method SetSize (TableW longint, TableH longint)
var FormX, FormY, FormW, FormH longint
endvar
GetPosition (FormX, FormY, FormW, FormH)
SetPosition (FormX, FormY, TableW + 170, TableH + 430)
endmethod
This method is in the table:
method open(var eventInfo Event)
var TableX, TableY, TableW, TableH longint
endvar
Self.GetPosition (TableX, TableY, TableW, TableH)
Self.SetPosition (0, 0, TableW, TableH)
#OpenOptsForm.SetSize (TableW, TableH)
endmethod
This seems to work OK. The funny numbers (170, 430) in the form SetSize
method are to allow for the scroll bar and borders and were figured out
by trial and error - once I realised the measurements weren't in pixels
but in twips or something.
Thanks for your input.
Regards, FIM.
* * Windows: an 80486 to XT Conversion Kit.
---
---------------
* Origin: Pedants Inc. (3:711/934.24)
|