Prevent move of Forms

fve
fve Member Posts: 28
Hello,

We have a customer that uses RF Terminals (with small displays) to scan data into the database.
We've developed a special set of small forms that fit exactly on the small display of the RF Terminals.

Now the users complain that they sometimes (accidently) drag and drop the forms (outside the visible range), so they cannot use them.

Is there a way to adjust forms so they cannot be dragged from the fixed position we use on opening?

Comments

  • Luc_VanDyck
    Luc_VanDyck Member, Moderator, Administrator Posts: 3,633
    fve wrote:
    Is there a way to adjust forms so they cannot be dragged from the fixed position we use on opening?
    I don't think you can prevent dragging of the forms. But you can set the X & Y position on opening, so next time they will open the form, it will be displayed at the correct position.

    Use
    CurrForm.XPOS := 100;
    CurrForm.YPOS := 100;
    
    in the OnOpenForm trigger.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • fl
    fl Member Posts: 184
    Hi,

    Yes you could add some code in the ontimer section of the form. In that code you can change the xpos and xpos properties of the form to 0, so that the forms are positioned left, uppercorner.
    Francois
    Consultant-Developper

    http://www.CreaChain.com
  • kine
    kine Member Posts: 12,562
    There is way:

    1) Add Label which will cover whole form, set some caption which will be not visible, set font size to small number. (this prevent user to move the form by dragging it), keep the label in the back, behind all other controls...
    2) Set BorderStyle and CaptionBar to None (this prevent user to drag it by caption or by border)
    3) Set Maximizable and Sizeable to no - there will be no border etc...
    4) Set AutoPosition = CenterScreen - the form will be opened in center of the screen, you just needs to center the terminal server view, you do not need search for the form...
    5) SavePosAndSize = No - to prevent saving position - just to be sure...
    6) LeaderDots = No - else you will have dots on the form... :-)

    That's it...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.