Pear Linux tutorial, tips and how to

 

Gambas Tutorial - Center the form on startup

Hi, see you again on Gambas tutorial. This time we'll continue to learn about Gambas programming. On the previous post, I've written how to create new project and create our first Hello World application. Now I want to show you how to make the form position in the center of the screen everytime we launch our application. By default, Gambas will display the form on the top left of the screen and I think its important to move it to the center on startup. 

Here is the clue. Find the section Public Sub Form_Open() on the FMain class. Me.Center code will move the form to the center of the screen everytime the form is opened. 

Public Sub Form_Open()

Me.Title = "First Exercise"

Me.Center

End

Here is the result

Comments :

0 comments to “Gambas Tutorial - Center the form on startup”