Tab Selection Notify Event

Template

context:u(2),code:i(1),id:u(2),objtype:i(2),tabidx:i(2)

This Notify event is generated when a tab index is selected. Typically, an application program will display data on the associated child window after detecting this event. The notice string returns the selected tab index. Tab indices are defined in ResBuilder or with the 'TABCTRL' mnemonic. The left tab has an index of 0, the next tab to the right has an index of 1, and so on. (Tab indices are zero-based.)

Field

Description

context

Context on which event occurred.

code

Always 2.

id

ID of the tab control.

objtype

Always 106.

tabidx

Index of the selected tab (zero-based).

Example

The following statements check for the user selecting different tabs. These statements would appear in an event loop, and assume that the generic$ variable has been templated:

if event.code$="N" then
   generic$=notice(sysgui,event.x);
   dim notice$:noticetpl(generic.objtype,event.flags);
   notice$=generic$
if event.code$="N" and notice.code=2 and event.id=tab_control_id then
   if notice.tabidx=1 then
      gosub display_tab1_values
   else if notice.tabidx=2 then
      gosub display_tab2_values
   else
      gosub display_tab3_values

See Also

NOTICE() Function - Get SYSGUI Notice String

NOTICETPL() Function - Get Notice String Template

Tab Deselection Notify Event

Tab Control Notify Events

BBjTabSelectedEvent