[Gambas-user] Two question on creating a form with controls from code
Willy Raets
willy at ...2734...
Sat Aug 25 23:01:13 CEST 2012
Hi,
I've been playing with creating forms from code and run into a few
problem. Gambas documentation doesn't provide me the answer.
1. In IDE you have a form property Scaled (just below resizable) that
can be set to True or False (see attached screenshot).
When creating a form from code it seems impossible to set the Scaled
property. Looked for it in the documentation but can't seem to find
anything, or did I miss something?
Example
Dim FrmTest As New Form
With FrmTest
.Caption = "Test form"
.AutoResize = False
.Height = 360
.Width = 580
.TopOnly = True
.Scaled = False '<==== this doen't work, so how does it work?
.Center
.Show
End With
2. Font documentation is very unclear on how to set a font on a control
created from code.
http://www.gambasdoc.org/help/comp/gb.qt4/control/font?v3
Example:
Dim FrmTest As New Form
Dim lblTest As Label
lblTest = New Label(FrmTest)
With lblTest
.Height = 20
.Width = 80
.X = 10
.Y = 10
.Text = "Text on Label test"
.Font '<=== How do I set the font for example to MonoSans, 10 pt?
End With
Someone any hints, examples or links to a solution?
Thanks,
Willy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Form-Scaled.png
Type: image/png
Size: 11553 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120825/bdb7dbfa/attachment.png>
More information about the User
mailing list