FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

CONTROLS

Get the name of a control


Try this...

CLEAR LOCAL
LOCAL FN GetBtnName$(btnID%)
  DIM btnTitle$, btnH&
  btnH& = BUTTON(btnID%)
  LONG IF btnH&
    CALL GETCTITLE(btnH&, btnTitle$)
  END IF
END FN = btnTitle$

This taken from Frank Turovich's "Learning FutureBASIC II - The Toolbox".

Charlie Dickman


The "contrlRect" field is neither a pointer to the title nor a handle to the title. Instead, it's a 255-byte field which actually _contains_ the title. given a handle b& to the button's control record, you can get the title as follows:

theString$ = b&..contrlTitle$

Rick