reseting the text in a textbox
Posted
#1
(In Topic #521)
Enthusiast

Posted
Regular

At the start of your program copy initial text to Tag, something like:-
Then you can get it back:-
Posted
Enthusiast

I have a lot to learn
Posted
Regular

It often saves you creating a Public variable, and as its a Variant, its very flexible.
Posted
Enthusiast

This will leave Tag for other uses
TextBox.Placeholder (gb.qt4)
Property Placeholder As String
Return or set the placeholder text, i.e. the text displayed when the Text property is void.
Posted
Expert

The passed container is normally a panel or frame which contains all the 'maintenance' controls.
{text boxes, text areas, combo boxes, checkboxes etc…}
It will then recursivity search for controls and then set their chosen parameters to whatever it is that I need using the
Object.SetProperty & Object.getProperty commands.
This allows you to overcome the limited set of parameters exposed when you examine the child controls.
The main one is to Trim the text input areas as this overcomes a common problem with user input.
The InColour is used to return the display colour of a control back to a standard. In most cases this is black.
As part of a validation routine, I turn the label for the control red if an error is detected to assist the user in
quickly identifying where the error is.
Code (gambas)
This subroutine uses the same concepts to Reset a container's controls, ready to accept new input.
Code (gambas)
- TPanel = ControlElement
- FormResetControls(Tpanel[TmpInt]) ' It may have children so do a recursive search
- TStrip = ControlElement
- FormResetControls(TStrip[TmpInt]) ' It may have children so do a recursive search
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

stevedee said
The Tag property is often under-used (or over-looked) but its great for poking things away that you might need later.
It often saves you creating a Public variable, and as its a Variant, its very flexible.
I had a bad habit of using it to store information that should be have been delineated as part of its own class file though. Like for game logic values.
1 guest and 0 members have just viewed this.


