Under New Management
0 Members and 1 Guest are viewing this topic.
SUB dhfindSELECT @CLASSCASE @IDCONTROLSelect @CONTROLID'Findcase 19IF @notifycode=0find$ = GETCONTROLTEXT(d1,4)match_case = GETSTATE (d1, 20)'Foundif match_case=0 then Position = CONTROLCMD (w1, 1, @RTFINDTEXT, find$, Position, 1)if match_case=1 then Position = CONTROLCMD (w1, 1, @RTFINDTEXT, find$, Position, 0)'Highlight findCONTROLCMD w1,1,@RTHIDESEL,0CONTROLCMD w1,1,@RTSETSELECTION,Position,Position+len(find$)'No machif Position=-1 then MessageBox(0,"Search for "+chr$(34)+find$+chr$(34)+" no mach found.", "Find",1+64)Position=Position+1'Display line nocurrentlinenr=controlcmd(w1,1,@rtlinefromchar,-1)Lcount = CONTROLCMD ( w1,1,@RTGETLINECOUNT)CONTROLCMD w1,1000,@SWSETPANETEXT,3," Line"+str$(currentlinenr+1)+" of"+str$(Lcount)ENDIF'Cancelcase 9IF @notifycode=0closedialog d1,@IDOK ENDIFEndselectENDSELECTRETURN
DEF d1:DIALOG CONST BN_CLICKED = 0 CONST BN_SETFOCUS = 6 CONST BS_NOTIFY = &H4000 CONST BM_CLICK = &HF5 DEF answer:INT DEF CurrentButtonCID:INT DIALOG d1,0,0,213,129,0x80C80080,0,"Enter Selects Button",Handler CONTROL d1,"B,Hidden Default Button,71,18,70,20,0x40080001,10" CONTROL d1,"E,Edit Box,40,10,128,34,0x50811004,15"'BS_NOTIFY = Want the next three buttons to receive (BN_) Button Notification messages.CONTROL d1,"B,OK,23,55,70,20,0x50010000|BS_NOTIFY,11" CONTROL d1,"B,Cancel,119,54,70,20,0x50010000|BS_NOTIFY,12" CONTROL d1,"B,Close,71,90,70,20,0x50010000|BS_NOTIFY,13" answer = DOMODAL(d1) end sub Handler select @CLASS case @IDCONTROL select @CONTROLID case 10 :'default button (enter key) sendmessage (d1,BM_CLICK,0,0,CurrentButtonCID) 'BM_CLICK 'An application sends a BM_CLICK message to simulate the user clicking a button. 'This message causes the button to receive the WM_LBUTTONDOWN and WM_LBUTTONUP messages, 'and the button's parent window to receive a BN_CLICKED notification message. 'CurrentButtonCID is the button that has focus. case 11 if @notifycode=BN_SETFOCUS then CurrentButtonCID=@CONTROLID 'BN_SETFOCUS 'The BN_SETFOCUS notification code is sent when a button receives the keyboard focus. 'The button must have the BS_NOTIFY style to send this notification message. if @notifycode=BN_CLICKED then messagebox d1,"OK Button","OK" 'The button was selected using enter or mouse click. Execute our code. case 12 if @notifycode=BN_SETFOCUS then CurrentButtonCID=@CONTROLID if @notifycode=BN_CLICKED then messagebox d1,"Cancel Button","Cancel" case 13 if @notifycode=BN_SETFOCUS then CurrentButtonCID=@CONTROLID if @notifycode=BN_CLICKED then closedialog d1,@IDOK endselect case @IDINITDIALOG CENTERWINDOW d1 endselect return
To link to us use this code/button on your site