Recent

Author Topic: SOLVED: TDBNavigator question  (Read 1127 times)

jptferreira

  • New Member
  • *
  • Posts: 18
SOLVED: TDBNavigator question
« on: April 18, 2019, 03:14:19 pm »
I'm in need of hide tdbnavigator after switching to a TPageControl inside of the same form. I can hide it if the code is inside of the actual form but if it is inside of the TPageControl that is inside of that form.. then it doesn't work. Someone can shed a light on my issue?
Thanks! ;)
« Last Edit: April 18, 2019, 08:18:39 pm by jptferreira »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: TDBNavigator question
« Reply #1 on: April 18, 2019, 04:12:35 pm »
... I can hide it if the code is inside of the actual form but if it is inside of the TPageControl that is inside of that form.. then it doesn't work.
How does code "inside the actual form" differ from code "inside the TPageControl"?

Quote
Someone can shed a light on my issue?
Not without seeing the code that fails to do what you want it to do.

jptferreira

  • New Member
  • *
  • Posts: 18
Re: TDBNavigator question
« Reply #2 on: April 18, 2019, 04:51:09 pm »
When I add the ClientDBNV.Visible:=false;  it works if I use it when I have the that part of the form active. My problem is when I activate the TPageControl that has 3 pages. I need to be able to issue that command when a certain ActivePage becomes in use, however it only allow to do it for the whole Tpagecontrol.
To be more clear:
The command works but I need for it to only work when I select a certain page tab. That is not working because that OnShow option affects the whole TPageControl (all the pages on it)... need to know how to have it enabled only when that page is selected to disable the dbnavigator... I hope this helps.  Thanks!

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: TDBNavigator question
« Reply #3 on: April 18, 2019, 05:49:20 pm »
Is the dbnavigator parented by a pagecontrol tabsheet, or is it parented by the containing form?

jptferreira

  • New Member
  • *
  • Posts: 18
Re: TDBNavigator question
« Reply #4 on: April 18, 2019, 06:12:55 pm »
It is on the same form and inside of a TPanel.

Thanks

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TDBNavigator question
« Reply #5 on: April 18, 2019, 07:11:07 pm »
Add a handler for the page control OnChange event. For example, assuming it's the third tab:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControlChange(Sender: TObject);
  2. begin
  3.   ClientDBNV.Visible := PageControl.ActivePageIndex = 2;
  4. end;
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

jptferreira

  • New Member
  • *
  • Posts: 18
Re: TDBNavigator question
« Reply #6 on: April 18, 2019, 08:17:22 pm »
That did it! I feel bad I didn't think about it! I believe that too much going on at the office sometimes we can't think about the quick solution.
THANK YOU! :)

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: SOLVED: TDBNavigator question
« Reply #7 on: April 18, 2019, 11:30:22 pm »
Glad it helped :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018