New Form

Hi

  1. When I have some labels on main form I can select its text in Browser.
    But same kind label or panels caption or other texts are not selectable on created form. Should I set Some Property?

  2. Is it possible to change Main Form of Application?

  3. Can I navigate to some page/sub form? Like I want user will call some URL and some page will open?

Thanks

Some examples in the manual:
http://www.tmssoftware.biz/Download/Manuals/TMSWEBCoreDevGuide.pdf

For 3) you can call Application.Navigate to go to another url (page 102).

If you want to open one of your application's forms, you can find an example in the manual on page 108 ("Creating forms at runtime")

EdB

For item (1).

To disable selection of text you can add the 'user-select' to your CSS style:

* {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Opera and Firefox */
}

Looks I didn't described well.

I want to enable it on the form that I create dynamically.
This form is shown with popup := false;

Actually with popup := true effect is same.

Thanks

I found Application.AutoRouteForm: boolean. Will dig into it.

Is there way to set http headers while calling navigate function?

Sorry - I'm still finding this a little ambiguous...

"I want to enable it..." - what exactly is the "it" you are asking about?

If by 2 and 3 you mean "The user starts in my main form. I want to be able to have the page showing the main form to show a different form" then:

a) to switch to some other url in the same page, you can use:

Application.Navigate('some other url', ntPage);

b) to switch to another of your own application's forms you can use (see manual page 86 for explanation):

procedure TMenuFrame.LaunchForm(AInstanceClass: TFormClass);
var
  frm: TForm;

  procedure FormCreated(AForm: TObject);
  begin
    (AForm as TForm).Show;
  end;

begin
  if Uppercase(Application.ActiveForm.ClassName) <> Uppercase(AInstanceClass.ClassName) then
  begin
     Application.CreateForm(AInstanceClass, 'body', frm, @FormCreated);
   end;
end;

procedure TMenuFrame.WebLabel1Click(Sender: TObject);
begin
  LaunchForm(TForm1);
end;

procedure TMenuFrame.WebLabel2Click(Sender: TObject);
begin
  LaunchForm(TForm2);
end;

EdB

Oh

I mean to enable selecting text like caption of label in page.
Should I apply CSS? as I don't see any CSS applied to main form of application.

thanks

This span surrounds the form created manually.
It has "user-select: none" in style.

I even tried to set css class to it, but local style element has priority.
I assigned class .read to the forms ElementClassName property.

Is there any way to set this style element to true?

Pay attention that it is used in and in

under it. is it correct?

Pay attention that class assigned to the ElementClassName property of the form is used in "span" and in "div" under it.
Is it Correct?

Here is the span mentioned above.

span style="top: 0px; left: 0px; right: 0px; bottom: 0px; user-select: none; position: absolute; background-color: rgb(255, 255, 255);"

Actually I found solution :
I Applied following function to the onShowEvent of manually created form.

But it is not logical to disable selecting in manually created forms and not allow to change it in some propery.

asm
(function() {
'use strict';

let style = document.createElement('style');
style.innerHTML = '*{ user-select: auto !important; }';

document.body.appendChild(style);
})();
end;

P.S.
Now I have problem with mouse wheel scrolling.