AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

MDI Child hat falsche Größe

Ein Thema von Neutral General · begonnen am 12. Aug 2008 · letzter Beitrag vom 12. Aug 2008
Antwort Antwort
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#1

MDI Child hat falsche Größe

  Alt 12. Aug 2008, 10:00
Hi,

folgende, sehr simple, Anwendung:

Form1 (fsMDIForm) :

Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
end;

end.
Form2 (fsMDIChild):

Delphi-Quellcode:
object Form2: TForm2
  Left = 454
  Top = 284
  Width = 208 // <--- (!)
  Height = 234 // <--- (!)
// [...]

Delphi-Quellcode:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm2 = class(TForm)
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form2: TForm2;

implementation

{$R *.DFM}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

end.
Projektquelltext:

Delphi-Quellcode:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas{Form1},
  Unit2 in 'Unit2.pas{Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  // kein CreateForm für Form2 !
  Application.Run;
end.
wenn ich nun auf den Button klicke erscheint Form2 mit folgenden Werten:

Width: 726
Height: 428




+

PS: Ich benutze gerade Delphi 5

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#2

Re: MDI Child hat falsche Größe

  Alt 12. Aug 2008, 10:05
Setz die Größe im OnCreate nochmal neu.
  Mit Zitat antworten Zitat
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#3

Re: MDI Child hat falsche Größe

  Alt 12. Aug 2008, 10:23
Hi,

Das hatte ich auch schon probiert aber wenn man Anchors gesetzt hat bei verschiedenen Controls ist das schlecht.
Dann schrumpfen die nämlich zu nichts zusammen.

Auf dem Bild

1. Form in der IDE
2. Form im Programm nach der Größenanpassung im OnCreate der Form
3. Vergrößerung der Form durch den Benutzer

Ich kann natürlich zuerst die Formulargröße setzen und dann erst die Anchors der Controls. Aber wofür habe ich denn bitte den Formulardesigner wenn ich eh alles von Hand (neu) einstellen muss? Was ist das denn?

Gruß
Neutral General
Miniaturansicht angehängter Grafiken
problem_214.jpg  
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz