VBAndCs / sVB-Small-Visual-Basic

Small Visual Basic (sVB) is an educational programming language, created by Eng. Mohammad Hamdy as an evolved version of Microsoft Small Basic (SB). It is meant to be easier and more powerful at the same time, to introduce programming basics to kids and beginners of any age, provided that they can use the English keyboard on the Windows OS.
Other
233 stars 16 forks source link

DrawText() and DrawBoundText() for forms ... #30

Closed boa2145 closed 1 year ago

boa2145 commented 1 year ago

Good morning Mohammand,

could you, please, explain why you did not implement the methods DrawText() and DrawBoundText() for forms? I'd like to use theses both methods for forms , too.

In Small Basic there are not labels, but I can use these two methods to output text on GraphicsWindow. So, I appreciate these methods DrawText() and DrawBoundText() on GraphicsWindow, but I miss labels there. When I use a form with sVB, I appreciate labels, but I miss DrawText() and DrawBoundText(). The advantage of DrawText() and DrawBoundText() for forms could be that I don't have to handle with labels before to put out text on forms. For me it would be better to use both on forms: labels and DrawBoundText() resp. DrawText().

Have a nice day ... Gregor

VBAndCs commented 1 year ago

@boa2145 I see no use of these tow functions on the form. Labels are perfect in displaying text, and you can add them on the form in runtime if you want by calling:

n=n+1
newLabel = Me.AddLabel("newlabel" + n,  left, top, width, height)
newLabel.FontSize= 16
newLabel.Text = "Hello"
boa2145 commented 1 year ago

Hello Mohammad,

In the meantime I've tried different ways to output text in a form. I also think, that a label is the best way for displaying text in a form.

I was able to fix my problems with LabelName.Text and WinDelay(). Now it works.

Regards ... Gregor

VBAndCs commented 1 year ago

@boa2145 Please show me a sample to get what you mean.

boa2145 commented 1 year ago

See above, please. Everything is fine, Mohammad.