Hi,
Thanks for opening.
I'm writing a "fill-out" form in Delphi, with each section enclosed in its own tab, using TPageControl and TTabControl.
When the info on each tab has passed validation rules (all working fine), the next button is enabled and the tab can be moved on.
When the form runs, all the tabs which have not been used, i.e. all of them, are highligted. When 'Next' is clicked the tab will move on and the tab just used is highdimmed.
I have stripped this code down to it's bare bones and it still won't work: basically, it will move on the first time, and highdim correctly - but each subsequent time it will move on, but highdim the NEXT tab.
I can see nothing wrong with the code - can anyone spot any glaring errors.
This is my procedure. The showmessages show which tab is being worked on - again it works the first time but goes doo-lally the second.
procedure Tform_bookvisit.button_nextandbookClick(Sender: TObject);
begin
ShowMessage('current index '+inttostr(pgctrl_bookvisit.tabindex));
TTabSheet(pgctrl_bookvisit.Controls[pgctrl_bookvisit.tabindex]).Highlighted:=false;
ShowMessage('just highdimmed index '+inttostr(pgctrl_bookvisit.tabindex));
pgctrl_bookvisit.SelectNextPage(true); //:=pgctrl_bookvisit.TabIndex+1;
ShowMessage('just advanced index to '+inttostr(pgctrl_bookvisit.tabindex));
end;
Can anyone help? Can send the whole lot if anyone wants to try with it.
Many Thanks in advance,
Don