How Many Pages can be defined in TAB Control

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

How Many Pages can be defined in TAB Control

Post by jayadevu »

Hi All,

What is the maximum number of Pages we can define in a TAB Control ?

Warm regards,

Jayadev
User avatar
gfilatov
Posts: 1116
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: How Many Pages can be defined in TAB Control

Post by gfilatov »

jayadevu wrote:Hi All,

What is the maximum number of Pages we can define in a TAB Control ?
Hi Jayadev,

I was able to create 1000 Tab's pages in the sample below:

Code: Select all

#include "minigui.ch"

Function Main
Local bChange := {|| TabChange()}

   DEFINE WINDOW Form_1;
      AT 0,0;
      WIDTH 545 HEIGHT 440;
      TITLE 'Tab Control';
      MAIN;
      ON SIZE Form_1.Tab_1.Width := (Form_1.Width-45)

      DEFINE BUTTON Button_1
         ROW 275
         COL 10
         CAPTION 'Tab Change'
         ACTION Btn_1_Action()
      END BUTTON

      DEFINE BUTTON Button_2
         ROW 275
         COL 120
         CAPTION 'Last Page'
         ACTION Btn_2_Action()
      END BUTTON

      DEFINE TAB Tab_1;
         AT 10,10;
         WIDTH 500;
         HEIGHT 250;
         VALUE 1;
         ON CHANGE Eval(bChange)

       for i:=1 to 1000

         PAGE 'Tab Page '+hb_ntos(i)

         END PAGE

      next

      END TAB

   END WINDOW

   Form_1.Center

   Form_1.Activate

Return Nil


Procedure TabChange()
   Msginfo("Changed")
Return

Procedure Btn_1_Action()
   Form_1.Tab_1.Value := IF(Form_1.Tab_1.Value < 500, (Form_1.Tab_1.Value+1), (Form_1.Tab_1.Value-1))
Return

Procedure Btn_2_Action()
   Form_1.Tab_1.Value := 1000
Return
Hope that useful :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

Re: How Many Pages can be defined in TAB Control

Post by jayadevu »

Dear Mr. Filatov,

Many thanks for your reply, I should have checked myself.

Sorry for all the trouble.

Warm regards,

Jayadev
Post Reply