Recent

Author Topic: [SOLVED] Curious why this occurs - TDBNavigator?  (Read 203 times)

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 451
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
[SOLVED] Curious why this occurs - TDBNavigator?
« on: May 21, 2026, 04:57:24 pm »
I have a few forms that I have a DBGrid and DBNavigator for scrolling the grid. As far as edit, insert, delete, cancel and save functions I have a menu or using speedbuttons. On the DBNavigator - Visible Buttons, I have disabled nbCancel, nbDelete, nbEdit, nbInsert, nbPost and nbRefresh. Reason I want to write and better control these functions via TMainMenu and my own SpeedButtons.  This works fine except on the form all is disabled except the Bof, Up, Down and EoF.  Great, but at runtime, the Add or nbInsert is still showing???? Any ideas?

I'm going to code this in FormCreate to set these particular buttons to false and see if that does it. Be back in a bit to report.

Thanks, hardcoded it and all is good.
« Last Edit: May 21, 2026, 05:00:14 pm by 1HuntnMan »

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 451
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: [SOLVED] Curious why this occurs - TDBNavigator?
« Reply #1 on: June 10, 2026, 07:53:08 pm »
Yup, forgot to update this. My problem was I wanted to disable everything in the DBNav except just moving the pointer from record to record via the DBNav. I disabled everything except the first, prior, next and last so I could write my own code to Insert, Delete, Cancel or refresh but forgot that in my Create Procedure I had coded:

Code: Pascal  [Select][+][-]
  1.   DBNavClients.VisibleButtons:= [nbFirst, nbPrior, nbNext, nbLast, nbInsert];
  2.  

But, had disabled via the DBNav Visablebuttons but forgot about the code above so my code still had the nbInsert. Took awhile to figure that out. Thanks...

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 451
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: [SOLVED] Curious why this occurs - TDBNavigator?
« Reply #2 on: June 10, 2026, 07:53:21 pm »
Yup, forgot to update this. My problem was I wanted to disable everything in the DBNav except just moving the pointer from record to record via the DBNav. I disabled everything except the first, prior, next and last so I could write my own code to Insert, Delete, Cancel or refresh but forgot that in my Create Procedure I had coded:

Code: Pascal  [Select][+][-]
  1.   DBNavClients.VisibleButtons:= [nbFirst, nbPrior, nbNext, nbLast, nbInsert];
  2.  

But, had disabled via the DBNav Visablebuttons but forgot about the code above so my code still had the nbInsert. Took awhile to figure that out. Thanks...

 

TinyPortal © 2005-2018