Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

how to make a form static?

I don't want a form to be resized or moved, I was trying to catch the 'SIZE' event but not working well, is any other way I can make a form static?

Comments

  • Window->Properties->Frame-Thin
  • This can prevent resizing but not moving
    SRP_Set_MinMaxInfo
  • Cant move = Untick 'Title'
  • @BarryStevens,
    how Title and Frame-Thin relate to a form being static?
  • No frame to click on to move it or resize it.
    Try it and see. PS: save any text in your title in case you need to put it back.
    Or, Better still, save a copy before you do it.
  • @AusMarkB @BarryStevens
    so can I catch a 'move ' event and halt it?
  • The SIZE event is after the fact. You could try capturing the WINMSG event and looking for WM_WINDOWPOSCHANGING. You'd have to qualify the event to be synchronous, but I still don't know if it will work. You'll also have to work with the Struct functions in BASIC+ to modify the WINDOWPOS structure.

    In other words, it won't be trivial and it might not work.
  • edited July 14
    I started looking at this problem again, and it's actually quite simple to achieve what slowjams is asking.
    I spent ages trying to figure this out in 2018, and now I found out how to do it in 2020 in a few hours.
    Style = Get_Property(@window, "STYLE")
    Style[1,2] = ""
    Style = IConv(Style, "MX")
    * remove the specified style
    Style = bitand(Style, bitnot(0x00800000))
    Set_Property(@window, "STYLE", Style)


    The form is an mdi-child, but it has no border, and hence can't be moved.

Sign In or Register to comment.