Automatically fit form to resolution
Posted
#1
(In Topic #898)
Enthusiast

I send you an example that depending on your resolution, you have to change the height of the window so that there is no going up or down. If they can't see it they will have to change the resolution to understand it.
My resolution for this example is 1600x1024
My question is, how can I start the application at a window size where the scroll bar does not exist?
It is possible that this is not well understood, I apologize if this is the case.
Thanks.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Posted
Regular

Probably the answer lies in using MoveScaled in a Form_Open event handler.
There is a way to get the screen height but I can't find it at the moment. Maybe someone else can help here.
So what we want to do is use MoveScaled with x=0, y=0, height= the screen height and w=your design width.
BUT! This might not work too good if there is a top or bottom panel.
hth
b
p.s. or a possibly stupid easy way is just to maximise the form. i.e just set the FullScreen property to true in the form designer.
Posted
Guru

Question,, if you do not want the scroll bars then why use scrollview?
if you delete the scrollview container or change it into a scrollarea or a panel then the ContainerPanel works how you want it to and all fits in the screen. (see attached)
BruceS
Posted
Enthusiast

My most sincere thanks. cool
Look at the first answer it has inspired me and thanks to it I think I have found the solution.
Regarding the second one, I appreciate it but ScrollView is there for an important reason. And it is to visualize let's say a very long vertical sheet as if it were a web. Therefore changing the design is for me a patch.
Young and not so young, I am going to give you my solution and in turn my proposal:
Code
' this is the solution for our case (FMain.Open)
Me.Height = Desktop.Height
Code
' this solution is in the case that there is an HBox1 at the top (FMain.Open)
Me.Height = Desktop.Height - HBox1.Height
I hope you agree and if not please tell me a much better idea. Thank you very much
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
1 guest and 0 members have just viewed this.


