Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1080083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:58:17+00:00 2026-05-16T21:58:17+00:00

The following code works ! with pagecontrol1 do begin case Myindex of 0: activepage

  • 0

The following code works !

with pagecontrol1 do
begin
  case Myindex of
    0: activepage := tabsheet1;
    1: activepage := tabsheet2;
    2: activepage := tabsheet3;
  end;
end;
show;

The following code does not work

with pagecontrol1 do
begin
  case Myindex of
    0: activepage := tabsheet1;
    1: activepage := tabsheet2;
    2: activepage := tabsheet3;
  end;
end;
showmodal;

how to solve this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T21:58:17+00:00Added an answer on May 16, 2026 at 9:58 pm

    the problem was when I create a new form in runtime, and set active page before I use showmodal, the command seem to be ignored, however if I show it as normal “show” it works.

    I made a workaround for this for people interrested by using a postmessage so the command can be triggered after the modal form is shown.

    ...
    private
        Procedure WM_UserPage(var Msg: TMessage); message WM_USER+1;
    ...
    
    procedure TForm2.UserPage(var Msg: TMessage);
    begin
      with pagecontrol do
      case Msg.LParam of
        0: activepage := tabsheet1;
        1: activepage := tabsheet2; 
        2: activepage := tabsheet3; 
      end;
    end;
    
    from my first form I call : 
    
    procedure TForm1.ShowPage(PageNumber: integer);
    var
      MyForm : TForm2;
    begin
      MyForm := TForm2.create(self);
      with MyForm do
      try
        PostMessage(MyForm.Handle, WM_USER+1, 0, PageNumber);
        showmodal;
      finally
        FreeAndNil(MyForm);
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following code works fine in Firefox. In IE(8.0) button 2 does not work. $('<button
The following code works as expected on CentOS and Ubuntu O/s but not on
The following code works with Visual Studio 2008 but not with GCC/G++ 4.3.4 20090804.
following code works perfectly on FF and Chrome but not in IE8. $(window).keyup(function(e) {
The following code works with IE9 but not with IE8 HTMLInstance.attachEvent(onclick , function() {
Following code works def lab Proc.new { return foo1 }.call return foo2 end puts
The following code works great in IE, but not in FF or Safari. I
The following code works perfectly in Firefox, but not in IE or Chrome... Any
The following code works sometimes and most of the time not: WebBrowserTask wbt =
The following code works only in Firefox, but not in IE. The word Meanscoil

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.