GUI/Maximum window dimensions: Difference between revisions

Content added Content deleted
m (whitespace)
Line 23: Line 23:
From with the project create a form (FMain) with the following properties set:
From with the project create a form (FMain) with the following properties set:


<lang gambas>
<lang gambas>FMain.Maximized = True
FMain.Visible = False ' The form can be invisible</lang>
FMain.Maximized = True
FMain.Visible = False ' The form can be invisible
</lang>


From within the projectview, rightclick the FMain form and select Edit class from the contextmenu. This will display a form class file (FMain.class) as follows:
From within the projectview, rightclick the FMain form and select Edit class from the contextmenu. This will display a form class file (FMain.class) as follows:


<lang gambas>
<lang gambas>PUBLIC SUB _new()
PUBLIC SUB _new()


END
END
Line 37: Line 34:
PUBLIC SUB Form_Open()
PUBLIC SUB Form_Open()


END
END</lang>
</lang>


=== Adding the form resize event ===
=== Adding the form resize event ===
Line 44: Line 40:
We can now add a Form_Resize() event to the class file with the necessary code to obtain the screen dimensions as follows:
We can now add a Form_Resize() event to the class file with the necessary code to obtain the screen dimensions as follows:


<lang gambas>
<lang gambas>PUBLIC SUB Form_Resize()
PUBLIC SUB Form_Resize()
PRINT "The maximum window size that can be used without scrolling is "; FMain.Width; " x "; FMain.Height
PRINT "The maximum window size that can be used without scrolling is "; FMain.Width; " x "; FMain.Height
END
END</lang>

</lang>


== {{header|Visual Basic}} ==
== {{header|Visual Basic}} ==