Introduction to PowerBuilder

HomePrevious Lesson: CONSTANTS in PowerScript
Next Lesson: Retrieve Only as Needed

Displaying Help in the Login Window

Do you remember defining TAG values for each SingleLineEdit control in the w_login window? We defined those values to display them as help for the user.

w_login window is not a window of type MDI with MircroHelp, it is a response window. That means, we don't have the status bar to display help. That is the reason for painting a StaticText control st_help at the bottom of the window.

Write the following code in GetFocus event for all SingleLineEdit controls in the w_login window.
// Object: All SingleLineEditControls in w_login window
// Event: GetFocus
st_help.text = This.tag

Write the following code in LooseFocus event for all SingleLineEdit controls in the w_login window.
// Object: All SingleLineEditControls in w_login window
// Event: LooseFocus
st_help.text = "Ready"

What we are doing here is, setting the tag value of the current control as the text of the st_help control in the GetFocus event. When the control looses the focus, we are setting the help to a generic word 'Ready'. Run the application and see how it works.
HomePrevious Lesson: CONSTANTS in PowerScript
Next Lesson: Retrieve Only as Needed