Why isn’t the style being applied?

Asked

Viewed 61 times

3

I have the following program:

program Paker;

{$APPTYPE GUI}

uses
  Vcl.Forms, Classes, SysUtils, Vcl.StdCtrls;

var
    FForm : TForm;
    FModeComb : TComboBox;
    FBtn : TButton;

begin
    Application.Initialize;
    Application.CreateForm(TForm, FForm);

    FForm.BorderStyle := bsDialog;
    FForm.Caption := 'Choose a Mode:';
    FForm.Position := poDesktopCenter;
    FForm.OldCreateOrder := false;
    FForm.PixelsPerInch := 96;

    FModeComb := TComboBox.Create(nil);
    FModeComb.Parent := FForm;
    FModeComb.Left := 4;
    FModeComb.Top := 4;
    FModeComb.Width := 152;
    FModeComb.Style := csDropDownList;
    FModeComb.Items.Add('Encrypting resource files.');
    FModeComb.Items.Add('Mixing files into packages.');
    FModeComb.ItemIndex := 0;

    FBtn := TButton.Create(nil);
    FBtn.Parent := FForm;
    FBtn.Left := FModeComb.Width + 8;
    FBtn.Top := 4;
    FBtn.Width := 64;
    FBtn.Height := FModeComb.Height;
    FBtn.Caption := 'Go!';

    FForm.ClientHeight := FModeComb.Height + 4 + 4;
    FForm.ClientWidth := 12 + FModeComb.Width + FBtn.Width;

    Application.Run;

end.

The problem is that the components are demonstrating the old look of the Delphis 7 and earlier. Am I leaving any configuration behind? Does anyone know how to enable the normal style of XE applications?

1 answer

2


Include in Uses to Unit Vcl.XPMan this should apply the style.

inserir a descrição da imagem aqui

  • All form apps created automatically include Xpman and I’ve never seen?

  • So how is it done in the applications created by the menu? If you know, you can include in the body of the answer, to be more complete.

  • It is possible to create "VCL forms" in Runtime?

  • 1

    @Guill Segundo that answer in the Soen is possible, however laborious, the best way would be to use the XPManifest to show effect.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.