Here it works also with a timer.interval := 1.
________________________________ De : Fred vS <fi...@hotmail.com> Envoyé : lundi 3 février 2025 14:24 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net> Objet : Re: [MSEide-MSEgui-talk] TDBNAVIGATOR Hello Med. Indeed, when using that for tdatasource1.onstatechange: procedure tmainfo.onstatechange(const sender: TObject); begin tdbnavigator1.buttons[16].enabled:=false; writeln('yep'); end; only "yep" appears in the console but the button find is not disabled. But if you use a timer, it works: procedure tmainfo.onstatechange(Sender: TObject); begin ttimer1.enabled := true; end; procedure tmainfo.ontimer(const sender: TObject); begin tdbnavigator1.buttons[16].enabled:=false; writeln('yep'); end; ________________________________ De : Mohamed Hamza <medhom...@gmail.com> Envoyé : lundi 3 février 2025 14:00 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net> Objet : Re: [MSEide-MSEgui-talk] TDBNAVIGATOR Hi All, The idea is to disable ( not hide ) dbnb_find button (dbnavigator.button[16]) and to re-enable it after the user enter the value to find. I tried tdbnavigator.button[16].enabled:=false but no success. you can try : tdatasource1.onstatechange:=whenStateCh procedure form1.whenstateCh(sender:tobject) begin if dataS.state=dsFilter then tdbnav.buttons[16].enabled:=false; Regards Med .NB : Of course there is an other procedure where we do tbnav.button[16]:=true. Le lun. 3 févr. 2025 à 12:48, vasi vasi <funl...@gmail.com<mailto:funl...@gmail.com>> a écrit : Maybe he want to say that there is no automated functionality as probably on other DB navigators from Lazarus/Delphi? You know, when you are at the end of your records, autmatically, tha navigator disables the buttons that leads you in that direction? On Mon, Feb 3, 2025 at 1:42 PM Fred vS <fi...@hotmail.com<mailto:fi...@hotmail.com>> wrote: Hello Med. Once again, I think I did not understand what you want, sorry. Here, to disable the visible "find" button and so disable the onexecute if click on the button works with this: tdbnavigator1.buttons[ord(dbnb_find)].enabled := false; Please explain what you want. ________________________________ De : Mohamed Hamza <medhom...@gmail.com<mailto:medhom...@gmail.com>> Envoyé : lundi 3 février 2025 12:34 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net>> Objet : Re: [MSEide-MSEgui-talk] TDBNAVIGATOR Hello FRed I do not said hide but disable the button must be showed but does not exécuté the action . I tried navigator.button but non success. Le lun. 3 févr. 2025, 12:13, Fred vS <fi...@hotmail.com<mailto:fi...@hotmail.com>> a écrit : Re-re hello Med. For info, you may also change the color of the button: tdbnavigator1.buttons[ord(dbnb_find)].color := cl_red; Also change the color of the glyph: tdbnavigator1.buttons[ord(dbnb_find)].colorglyph := cl_green; Or, the hint of the button: tdbnavigator1.buttons[ord(dbnb_find)].hint := 'I am the find button'; From previuos post, enable/disable: tdbnavigator1.buttons[ord(dbnb_find)].enabled := false; Visible/hide: tdbnavigator1.buttons[ord(dbnb_find)].visible := false; Fre;D ________________________________ De : Fred vS <fi...@hotmail.com<mailto:fi...@hotmail.com>> Envoyé : lundi 3 février 2025 11:40 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net>> Objet : RE: [MSEide-MSEgui-talk] TDBNAVIGATOR Re-hello Med. OK, I (think) I get it: tdbnavigator1.buttons[ord(dbnb_find)].enabled := false; Cheers. Fre;D ________________________________ De : Fred vS <fi...@hotmail.com<mailto:fi...@hotmail.com>> Envoyé : lundi 3 février 2025 11:34 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net>> Objet : RE: [MSEide-MSEgui-talk] TDBNAVIGATOR Hello Med. At first look (I dont have my dev machine at the moment) I dont see how to disable the buttons. But you may show only the button you want, for example "tdbnavigator1.visiblebuttons :=[dbnb_first, dbnb_last, dbnb_find];" Fre;D ________________________________ De : Mohamed Hamza <medhom...@gmail.com<mailto:medhom...@gmail.com>> Envoyé : lundi 3 février 2025 06:20 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net>> Objet : [MSEide-MSEgui-talk] TDBNAVIGATOR Hi All, Does anyone have any idea to Enable/Disable buttons of tdbnavigator at runtime. Regards. Med. _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk -- Vasi _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net<mailto:mseide-msegui-talk@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
_______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk