Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form resizing

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Dear All,

Please help in my first Paradox steps!

I need to fix some bugs in the program written in Paradox. It consists of a main form with buttons and a few forms that open when you click the appropriate button.

The problem is that one of the form can not be resized. It is bigger then the screen size, or smaller, depending on resolution, but cannot be resized. All other forms are always the same as window size and are resized easily. I mean they always fit in the window with all fields, buttons, etc.

I tried to compare this problematic form with the others, but they seem to have the same properties.
What property(or anything else???) should be changed so that it could always fit in the screen?

Thank you so much for help!

 
Novice,

Try this:

1. Open the troublesome form in Design mode
2. Choose Format | Window Style to display the Window Style dialog box.
3. See if the Window Style setting is set to Dialog box. If so, change that to Window and then choose OK.
4. Save and then close your form.
5. Open the form as normal. It should now be resizeable.

The only "useful" way to have forms that always fit the screen in Paradox is to open them maximized, but since Paradox doesn't handle scaling or resizing well, it's a limited solution at best.

Personally, I take the other approach and open all forms in the center of the screen. That way, they usually look the way I want them to and don't show lots of wasted space.

Hope this helps...

-- Lance

 
Thank you for response
I did everything exactly as you said. However it didn't help. Style already was set to "window" and box "Fit to screen" was checked. This troublesome window has the same properties set in Format|Window Style as all the other windows, but still behaves differently.

Maybe you know any other thing that could cause that?

Thanks again
 
Novice,

Hm. Are you opening the form directly or with ObjectPAL, perhaps from a button or menu command? If the latter, your code may be controlling the way the form's opened.

If it is just a standalone form, feel free to zip it up with the tables it uses and then email the ZIP file to to address on my profile. I'll check it out on my machine.

Be sure to include any relevant details, such as the version of Paradox you're using, Windows version, and so on. I'll reply to the thread with a summary of any findings.

Hope this helps...

-- Lance
 
Below is code that is attached at the Form Level. I use this code on all my applications so that it will automatically resize the forms regardless of what the individual user has set his screen for.

Methods - Var
ThisForm Form
AspRatio Number


Events - SetFocus
MenuAction(MenuPropertiesZoomFitWidth)


Events - Open
Var
ix, iy,
iw, ih LongInt

EndVar


if eventInfo.isPreFilter() then

else
;// This code executes only for the form
DoDefault
Thisform.attach()
Thisform.GetPosition(ix,iy,iw,ih)
AspRatio = Number(iw) / Number(ih)
maximize()


endIf


Events - KeyPhysical
if eventInfo.isPreFilter() then
;// This code executes for each object on the form



if GetNetUserName() = "acmulfor" then
else
Switch
Case eventinfo.vchar() = "VK_F7":
DisAbleDeFault
msgstop("Error","Action Not Allowed")

Case eventinfo.vchar() = "VK_F5":
DisAbleDeFault
msgstop("Error","Action Not Allowed")

Case eventinfo.vchar() = "VK_F8":
DisAbleDeFault
msgstop("Error","Action Not Allowed")

Case eventinfo.vchar() = "VK_F9":
DisAbleDeFault
msgstop("Error","Action Not Allowed")

EndSwitch

endif

if GetNetUserName() = "rcmyers" or GetNetUserName() = "acmulfor" then
else

Switch

Case Eventinfo.isControlKeyDown() and eventinfo.vchar() = "VK_F4" :
DisableDefault
msgstop("Error","Action Not Allowed")

Case eventInfo.isAltKeyDown() and eventinfo.vchar() = "VK_F4":
disabledefault
msgstop("Error","Action Not Allowed")

Case eventInfo.isAltKeyDown() and eventinfo.vchar() = "VK_CANCEL":
disabledefault
msgstop("Error","Action Not Allowed")
Case eventInfo.isControlKeyDown() and eventinfo.vchar() = "VK_CANCEL":
disabledefault
msgstop("Error","Action Not Allowed")

Case eventInfo.isAltKeyDown() and eventinfo.vchar() = "VK_PAUSE":
disabledefault
msgstop("Error","Action Not Allowed")

Case eventInfo.isControlKeyDown() and eventinfo.vchar() = "VK_PAUSE":
disabledefault
msgstop("Error","Action Not Allowed")
EndSwitch

endif
endif




Events - MenuAction

Var

Mycaller Form
evid SmallInt
ix, iy, ih, iw,
ox, oy, oh, ow,
newHeight,
newWidth LongInt

EndVar

if eventInfo.isPreFilter() then


else


evid = eventinfo.id()

Switch
case evId = MenuControlSize:
thisForm.GetPosition(ox,oy,ow,oh)
dodefault
thisform.setposition(ix,iy,iw,ih)

if iw <> ow then
Newheight = Longint( number(iw) / aspRatio )
thisform.setposition(ix,iy,iw,newheight)
else
newwidth = LongInt( number(ih)*aspRatio )
thisform.setposition(ix,iy,newwidth,ih)
endif


case evid = MenuWindowCascade:
dodefault
thisform.getposition(ix,iy,iw,ih)
if aspRatio < ( number(iw) / number(ih) ) then
Nwewidth = Longint( number(ih) * aspratio )
thisform.setposition(ix,iy,newwidth,ih)
endif
endswitch

endIf
if eventInfo.id() = MenuControlSize then
eventInfo.setErrorCode(UserError)
endIf

if eventInfo.id() = MenuControlMinimize then
eventInfo.setErrorCode(UserError)
maximize()
endIf

if eventInfo.id() = MenuControlClose then
disabledefault
eventInfo.setErrorCode(UserError)
endIf

if eventInfo.id() = MenuControlMove then
eventInfo.setErrorCode(UserError)
endIf

if eventInfo.id() = MenuControlMouseMenu then
disableDefault
eventInfo.setErrorCode(UserError)
endIf

if eventInfo.id() = MenuControlNextwindow then
disableDefault
eventInfo.setErrorCode(UserError)
endIf


 
Novice,

Well, there's nothing in there that should slow it down precipitously. What about the data model? Are you using queries (.QBE files) in there? If so, that's a definite cause, but based on your earlier description, I doubt that's what your specific problem is.

What did the version check turn up?

Also, try verifying that it's using a stylesheet that actually exists. (See for details and related articles.)

Finally, make sure you're not saving the form with a saved filter/range.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top