Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Clicked – PB Docs 150 – PowerBuilder Library

Clicked – PB Docs 150

Clicked event

The Clicked event has different arguments for different
objects:

Object

See

Menus

Syntax 1

ListView and Toolbar controls

Syntax 2

Tab controls

Syntax 3

TreeView controls

Syntax 4

Window and progress bar controls

Syntax 5

Other controls

Syntax 6

For information about the DataWindow control’s Clicked
event, see the DataWindow Reference or the
online Help.

Syntax 1 For menus

Description

Occurs when the user chooses an item on a menu.

Event ID

Event ID

Objects

None

Menu

Parameters

None

Return Values

None (do not use a RETURN statement)

Usage

If the user highlights the menu item without choosing it,
its Selected event occurs.

If the user chooses a menu item that has a cascaded menu associated
with it, the Clicked event occurs, and the cascaded menu is displayed.

Examples

This script is for the Clicked event of the New menu
item for the frame window. The wf_newsheet function
is a window function. The window w_genapp_frame is
part of the application template you can generate when you create
a new application:

See Also

Syntax 2 For ListView controls

Description

Occurs when the user clicks within the ListView control, either
on an item or in the blank space around items.

Event ID

Event ID

Objects

pbm_lvnclicked

ListView

Parameters

Argument

Description

index

Integer by value
(the index of the ListView item the user clicked). The value of index is
-1 if the user clicks within the control but not on a specific item.

Return Values

Long. Return code choices (specify in
a RETURN statement):

  • 0 Continue
    processing

Usage

The Clicked event occurs when the user presses the mouse button.
The Clicked event can occur during a double-click, in addition to
the DoubleClicked event.

In addition to the Clicked event, ItemChanging and ItemChanged
events can occur when the user clicks on an item that does not already
have focus. BeginLabelEdit can occur when the user clicks on a label
of an item that has focus.

note.png Using the ItemActivate event for ListView controls

You can use the ItemActivate event (with the OneClickActivate
property set to true) instead of the Clicked
event for ListView controls.

Examples

This code changes the label of the item the user
clicks to uppercase:

See Also

Syntax 3 For Tab controls

Description

Occurs when the user clicks on the tab portion of a Tab control.

Event ID

Event ID

Objects

pbm_tcnclicked

Tab

Parameters

Argument

Description

index

Integer by value (the index of the tab
page the user clicked)

Return Values

Long. Return code choices (specify in
a RETURN statement):

  • 0 Continue
    processing

Usage

The Clicked event occurs when the mouse button is released.

When the user clicks in the display area of the Tab control,
the tab page user object (not the Tab control) gets a Clicked event.

The Clicked event can occur during a double-click, in addition
to the DoubleClicked event.

In addition to the Clicked event, the SelectionChanging and
SelectionChanged events can occur when the user clicks on a tab
page label. If the user presses an arrow key to change tab pages,
the Key event occurs instead of Clicked before SelectionChanging
and SelectionChanged.

Examples

This code makes the tab label bold for the fourth
tab page only:

See Also

Syntax 4 For TreeView controls

Description

Occurs when the user clicks an item in a TreeView control.

Event ID

Event ID

Objects

pbm_tvnclicked

TreeView

Parameters

Argument

Description

handle

Long by value (the
handle of the TreeView item the user clicked)

Return Values

Long. Return code choices (specify in
a RETURN statement):

  • 0 Continue
    processing

Usage

The Clicked event occurs when the user presses the mouse button.

The Clicked event can occur during a double-click, in addition
to the DoubleClicked event.

In addition to the Clicked event, GetFocus occurs if the control
does not already have focus.

Examples

This code in the Clicked event changes the label
of the item the user clicked to uppercase:

See Also

Syntax 5 For windows and progress bars

Description

Occurs when the user clicks in an unoccupied area of the window
or progress bar (any area with no visible, enabled object).

Event ID

Event ID

Objects

pbm_lbuttonclk

Window

pbm_lbuttondwn

HProgressBar, VProgressBar

Parameters

Argument

Description

flags

UnsignedLong by
value (the modifier keys and mouse buttons that are pressed).

Values are:

  • 1 – Left
    mouse button

  • 2 – Right mouse button (windows only)

  • 4 – Shift key

  • 8 – Ctrl key

  • 16 – Middle mouse button (windows only)

In the Clicked event for windows, the left mouse button is being
released, so 1 is not summed in the value of flags.

For an explanation of flags,
see Syntax 2 of MouseMove.

xpos

Integer by value
(the distance of the pointer from the left edge of the window workspace
or control in pixels).

ypos

Integer by value
(the distance of the pointer from the top of the window’s
workspace or control in pixels).

Return Values

Long. Return code choices (specify in
a RETURN statement):

  • 0 Continue
    processing

Usage

The Clicked event occurs when the user presses the mouse button
down in progress bars and when the user releases the mouse button
in windows.

If the user clicks on a control or menu in a window, that
object (rather than the window) gets a Clicked event. No Clicked
event occurs when the user clicks the window’s title bar.

When the user clicks on a window, the window’s MouseDown
and MouseUp events also occur.

When the user clicks on a visible disabled control or an invisible
enabled control, the window gets a Clicked event.

Examples

If the user clicks in the upper left corner of the
window, this code sets focus to the button cb_clear:

See Also

Syntax 6 For other controls

Description

Occurs when the user clicks on the control.

Event ID

Event ID

Objects

pbm_bnclicked

CheckBox, CommandButton, Graph, OLE,
Picture, PictureHyperLink, PictureButton, RadioButton, StaticText,
StaticHyperLink

pbm_lbuttondown

DatePicker, MonthCalendar

Parameters

None

Return Values

Long. Return code choices (specify in
a RETURN statement):

  • 0 Continue
    processing

Usage

The Clicked event occurs when the user releases the mouse
button.

If another control had focus, then a GetFocus and a Clicked
event occur for the control the user clicks.

Examples

This code in an OLE control’s Clicked event
activates the object in the control:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x