Welcome, Guest
Username: Password: Remember me
General Purpose Components and Libraries, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Just information(TPageControl) 11 years 10 months ago #2250

  • ExDatis
  • ExDatis's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
Common controls -> TpageControl:
Hi everyone!
Sometimes I need to check ActivePageIndex.
//the first solution
{set active page}
if not PageControl1.ActivePageIndex = 0 then PageControl1.ActivePageIndex := 0; //doesn't work
//the second solution
if PageControl1.ActivePageIndex > 0 then PageControl1.ActivePageIndex := 0; //works excellent!
Strange, isn't that?!
Lazarus 1.1 FPC 2.7.1 (CT 2.7), OS XUbuntu 12.4 32bit.
Regards!

Please Log in or Create an account to join the conversation.

Just information(TPageControl) 11 years 10 months ago #2251

  • ExDatis
  • ExDatis's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 110
  • Thank you received: 9
:blush:
Oh, I'm so sorry. My mistake(I'm a little sleepy and tired):
correct way is:
if not(PageControl1.ActivePageIndex = 0) then PageControl1.ActivePageIndex := 0; //works excellent, of course
Regards.

Please Log in or Create an account to join the conversation.

Last edit: by ExDatis.
  • Page:
  • 1