At first glance SetWindowSizeLimits doesn't seem to work perfectly, but I suppose that with it you set the minimum and maximum of the internal size of the Form, not the total ones, including the borders. This is probably because there are various Form styles, even without borders.
So, assuming what I just wrote, I tried this code:
but both that variables return zero (the Form style is Default, with borders) and, for example, the minimum height allowed is 372 instead of the desired 410.
Log(frm.WindowWidth) writes a not so nice: NaN = Not a Number
I suppose (too many suppositions) I have to move that code where the Form has already been displayed but I don't think there is an ideal event, such as the Appear event of the B4XPages would be. (Don't suggest me to use the B4XPages, which I love and which I myself always suggest; that's what I did initially and then I had to redo the project without them).
I solved setting:
but that's not the best way to do it.
So, assuming what I just wrote, I tried this code:
B4X:
Dim FormVertBorderSize As Int = frm.WindowWidth - frm.Width
Dim FormHorBorderSize As Int = frm.WindowHeight - frm.Height
frm.SetWindowSizeLimits(515 + FormVertBorderSize, 410 + FormHorBorderSize, fx.PrimaryScreen.MaxX + FormVertBorderSize, fx.PrimaryScreen.MaxY + FormHorBorderSize)
but both that variables return zero (the Form style is Default, with borders) and, for example, the minimum height allowed is 372 instead of the desired 410.
Log(frm.WindowWidth) writes a not so nice: NaN = Not a Number
I suppose (too many suppositions) I have to move that code where the Form has already been displayed but I don't think there is an ideal event, such as the Appear event of the B4XPages would be. (Don't suggest me to use the B4XPages, which I love and which I myself always suggest; that's what I did initially and then I had to redo the project without them).
I solved setting:
B4X:
FormVertBorderSize = 16
FormHorBorderSize = 38
but that's not the best way to do it.
Last edited: