October 29, 2025, 01:09:07 PM

News:

IWBasic runs in Windows 11!


Notify codes

Started by ckoehn, December 02, 2014, 02:23:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ckoehn

Is this all of the "SETFOCUS", "LOSTFOCUS" notify codes?

@ENSETFOCUS
@LBNSETFOCUS
@CBNSETFOCUS
@NMSETFOCUS

@ENKILLFOCUS
@LBNKILLFOCUS
@CBNKILLFOCUS
@NMKILLFOCUS THEN

None of these detect when a @CHECKBOX or @SYSBUTTON, gets or loses the focus.  How can I do that?

I have a customer who wants me to "Highlight" around the control that has the focus".

Later,
Clint

LarryMc

openconsole
def win:WINDOW
CONST BN_KILLFOCUS = 7
CONST BN_SETFOCUS = 6
CONST BS_NOTIFY = 0x4000

openwindow win,0,0,600,350,@SIZE|@MINBOX|@MAXBOX,0,"Control Demo",&mainwindow
CONTROL win,@button,"QUIT",500,270,50,20,@TABSTOP|@CTLBTNDEFAULT,23

CONTROL win,@sysbutton,"SysButton 1",10,20,90,20,@TABSTOP|BS_NOTIFY,1
CONTROL win,@sysbutton,"SysButton 2",10,50,90,20,@TABSTOP|BS_NOTIFY,2
CONTROL win,@sysbutton,"SysButton 3",10,80,90,20,@TABSTOP|BS_NOTIFY,3

CONTROL win,@RADIOBUTTON,"Radio 1",10,120,80,20,@TABSTOP|@GROUP|BS_NOTIFY,4
CONTROL win,@RADIOBUTTON,"Radio 2",10,150,80,20,@TABSTOP|BS_NOTIFY,5

CONTROL win,@checkbox,"Check 1",10,200,80,40,@TABSTOP|@GROUP|BS_NOTIFY,6
CONTROL win,@checkbox,"Check 2",10,230,80,40,@TABSTOP|BS_NOTIFY,7

waituntil iswindowclosed(win)
closeconsole
end

SUB mainwindow(),int
select @CLASS
case @IDCLOSEWINDOW
closewindow win
case @IDCONTROL
SELECT @CONTROLID
case 1
select @notifycode
case BN_KILLFOCUS
?"sysbutton 1 kill focus"
case BN_SETFOCUS
?"sysbutton 1 get focus"
endselect
case 2
select @notifycode
case BN_KILLFOCUS
?"sysbutton 2 kill focus"
case BN_SETFOCUS
?"sysbutton 2 get focus"
endselect
case 3
select @notifycode
case BN_KILLFOCUS
?"sysbutton 3 kill focus"
case BN_SETFOCUS
?"sysbutton 3 get focus"
endselect
case 4
select @notifycode
case BN_KILLFOCUS
?"radio 1 kill focus"
case BN_SETFOCUS
?"radio 1 get focus"
endselect
case 5
select @notifycode
case BN_KILLFOCUS
?"radio 2 kill focus"
case BN_SETFOCUS
?"radio 2 get focus"
endselect
case 6
select @notifycode
case BN_KILLFOCUS
?"check 1 kill focus"
case BN_SETFOCUS
?"check 1 get focus"
endselect
case 7
select @notifycode
case BN_KILLFOCUS
?"check 2 kill focus"
case BN_SETFOCUS
?"check 2 get focus"
endselect
CASE 23
closewindow win
ENDSELECT
CASE @IDCREATE
CENTERWINDOW win
endselect
return 0
endsub
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ckoehn

Thank you very much LarryMc.  That did the trick.  I don't think I would have figured it out (or found it on the forum either.  My searching ability is terrible).

Later,
Clint