2013-05-23 8 views
5

Ich arbeite an einer großen Delphi-Anwendung mit einer Tonne Legacy-Code, der in xe2 konvertiert wird. Ich implementiere die vcl-Stile und zum größten Teil gibt es kein Problem.Delphi XE2 VCL-Stile, die TabSheets nicht korrekt zeichnen

In einigen Formularen, speziell wo ich ein tpanel habe, mit einer Seitensteuerung und Registerkarten auf ihnen, werden die Tabsheets manchmal nicht richtig gezeichnet. Sie zeigen an, welches Bild sich zuvor in dem Bereich befand, in dem sich die Registerkarte befindet. Wenn das Formular zum ersten Mal angezeigt wird, wird es der Hintergrundbildschirm auf meinem Computer sein, aber wenn ich Tabs ändere, scheint sich die Registerkarte Hintergründe/Labels/Komponenten zu überlappen.

Dies tritt nur auf, wenn ich die vcl-Stile verwende, wenn ich den Stil nicht anwende, scheint alles normal anzuzeigen.

Es tritt nur auf einigen Registerkarten auf. Ich habe versucht, eine bestimmte Eigenschaft oder Methodenaufruf (oder deren Fehlen) zu isolieren, die dieses Problem verursachen können, aber ich habe wirklich Schwierigkeiten, vor allem angesichts der reinen Größe der Methoden in diesem Code (in einigen Formen, die Methode ausgelöst wird auf der Registerkarte ändert sich über 1000 Zeilen Code).

Ich ging, um einige Screenshots zu machen, um dies zu demonstrieren, aber die Formen auf den Screenshots sind alle korrekt gerendert. Dies deutet darauf hin, dass es eine Art Trennung zwischen dem, was ich sehe, und dem, was tatsächlich "da" ist.

Jeder Rat würde am meisten geschätzt werden.

+1

Was der Inhalt eines Screenshot unterscheidet von dem, was Sie auf dem Bildschirm sehen tatsächlich –

+1

@MrLister Yep? , der mo s bizarre Sache, die ich gesehen habe. – Elissa

+0

Gibt es eine benutzerdefinierte Zeichnung im Code (Suche nach 'OnDraw')? Gibt es Probleme mit DoubleBuffering oder anderen Eigenschaften, die den Aufbau des Bildschirms beeinflussen können? –

Antwort

1

Vielleicht sollten Sie die Vcl Styles Utils verwenden, was viele Stilfehler in Delphi korrigiert. Wenn ich mich richtig erinnere, ist das Bemalen der TTabSheets standardmäßig falsch - außer dass Sie es in ein TPanel/etc.

0

ich in der Lage war, zu reproduzieren, was ich glaube, das gleiche Problem auf einem Windows XP-PC ist,
Fenster 8.1 schienen mit dem gleichen exe

Im laufenden Delphi XE 5

Starten Sie ein neue funktionieren Formulare VCL Anwendung

Kopieren Sie den Code unten in der Zwischenablage

Klicken Sie auf das Hauptformular in Ihrem neuen Projekt und einfügen

gehen Sie dann zu Projekt> Optionen> Anwendung> Darstellung> "Wählen Sie einen beliebigen Stil, z. Luna“

Führen Sie das Projekt, das Register‚hat ts3‘den Hintergrund, was dort vor war.

DoubleBuffered auf true auf dem Panel Einstellung wie oben von Elissa vorgeschlagen hat es besser

auch drucken lassen DBEdit15, DBEdit16 und DBEdit18 auf sichtbare falsche Einstellung vorgenommen drucken Sie es besser - aber ich war nicht in der Lage zu bestimmen, warum

object pgc1: TPageControl 
    Left = 0 
    Top = 0 
    Width = 635 
    Height = 299 
    ActivePage = ts3 
    Align = alClient 
    Font.Charset = DEFAULT_CHARSET 
    Font.Color = clWindowText 
    Font.Height = -11 
    Font.Name = 'Tahoma' 
    Font.Style = [] 
    ParentFont = False 
    TabOrder = 0 
    object ts3: TTabSheet 
    Caption = 'ts3' 
    Font.Charset = DEFAULT_CHARSET 
    Font.Color = clWindowText 
    Font.Height = -11 
    Font.Name = 'Tahoma' 
    Font.Style = [] 
    ImageIndex = 2 
    ParentFont = False 
    object pTotals: TPanel 
     Left = 3 
     Top = 36 
     Width = 486 
     Height = 237 
     BevelOuter = bvNone 
     DoubleBuffered = False 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clWindowText 
     Font.Height = -11 
     Font.Name = 'Tahoma' 
     Font.Style = [] 
     ParentDoubleBuffered = False 
     ParentFont = False 
     TabOrder = 0 
     object Label19: TLabel 
     Left = 3 
     Top = -4 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label21: TLabel 
     Left = 3 
     Top = 59 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label22: TLabel 
     Left = 3 
     Top = 115 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label23: TLabel 
     Left = 3 
     Top = 167 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clWindowText 
     Font.Height = -11 
     Font.Name = 'Tahoma' 
     Font.Style = [] 
     ParentFont = False 
     end 
     object Label24: TLabel 
     Left = 233 
     Top = 216 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     Visible = False 
     end 
     object Label29: TLabel 
     Left = 343 
     Top = 145 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label30: TLabel 
     Left = 343 
     Top = 165 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label48: TLabel 
     Left = 3 
     Top = 21 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label53: TLabel 
     Left = 319 
     Top = 91 
     Width = 8 
     Height = 13 
     Caption = 'llll' 
     end 
     object Label54: TLabel 
     Left = 3 
     Top = 139 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object Label64: TLabel 
     Left = 343 
     Top = 185 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object lbCons: TLabel 
     Left = 3 
     Top = 81 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     Visible = False 
     end 
     object lPeriod_1: TLabel 
     Left = 343 
     Top = -4 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object lPeriod_2: TLabel 
     Left = 343 
     Top = 16 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object lPeriod_3: TLabel 
     Left = 343 
     Top = 39 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object lPeriod_4: TLabel 
     Left = 343 
     Top = 60 
     Width = 8 
     Height = 13 
     Alignment = taRightJustify 
     Caption = 'llll' 
     end 
     object btnPayHist: TButton 
     Left = 15 
     Top = 200 
     Width = 121 
     Height = 25 
     Caption = 'btn' 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clWindowText 
     Font.Height = -11 
     Font.Name = 'Tahoma' 
     Font.Style = [] 
     ParentFont = False 
     TabOrder = 0 
     end 
     object btnRefreshTotals: TBitBtn 
     Left = 355 
     Top = 112 
     Width = 121 
     Height = 25 
     Caption = 'btn' 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clWindowText 
     Font.Height = -11 
     Font.Name = 'Tahoma' 
     Font.Style = [] 
     ParentFont = False 
     ParentShowHint = False 
     ShowHint = True 
     TabOrder = 1 
     end 
     object DBEdit13: TDBEdit 
     Left = 23 
     Top = 0 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ParentShowHint = False 
     ReadOnly = True 
     ShowHint = False 
     TabOrder = 2 
     end 
     object DBEdit14: TDBEdit 
     Left = 23 
     Top = 25 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ParentShowHint = False 
     ReadOnly = True 
     ShowHint = False 
     TabOrder = 3 
     end 
     object DBEdit15: TDBEdit 
     Left = 23 
     Top = 119 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 4 
     end 
     object DBEdit16: TDBEdit 
     Left = 23 
     Top = 171 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 5 
     end 
     object DBEdit17: TDBEdit 
     Left = 249 
     Top = 213 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     DataField = 'Last_Statement' 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 6 
     Visible = False 
     end 
     object DBEdit18: TDBEdit 
     Left = 23 
     Top = 143 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 7 
     end 
     object DBEdit19: TDBEdit 
     Left = 23 
     Top = 63 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 8 
     end 
     object DBEdit20: TDBEdit 
     Left = 23 
     Top = 87 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 9 
     Visible = False 
     end 
     object DBEdit21: TDBEdit 
     Left = 363 
     Top = 0 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 10 
     end 
     object DBEdit22: TDBEdit 
     Left = 357 
     Top = 16 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 11 
     end 
     object DBEdit23: TDBEdit 
     Left = 363 
     Top = 43 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 12 
     end 
     object DBEdit24: TDBEdit 
     Left = 363 
     Top = 64 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 13 
     end 
     object DBEdit25: TDBEdit 
     Left = 363 
     Top = 150 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 14 
     end 
     object DBEdit26: TDBEdit 
     Left = 363 
     Top = 170 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 15 
     end 
     object DBEdit27: TDBEdit 
     Left = 355 
     Top = 182 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 16 
     end 
     object DBEdit28: TDBEdit 
     Left = 363 
     Top = 96 
     Width = 121 
     Height = 21 
     TabStop = False 
     Color = clBtnFace 
     Ctl3D = True 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clBlack 
     Font.Height = -11 
     Font.Name = 'MS Sans Serif' 
     Font.Style = [] 
     ParentCtl3D = False 
     ParentFont = False 
     ReadOnly = True 
     TabOrder = 17 
     end 
    end 
    object Panel2: TPanel 
     Left = 0 
     Top = 0 
     Width = 627 
     Height = 30 
     Align = alTop 
     BevelOuter = bvNone 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clWindowText 
     Font.Height = -11 
     Font.Name = 'Tahoma' 
     Font.Style = [] 
     ParentFont = False 
     TabOrder = 1 
     object pDisp2: TPanel 
     Left = 69 
     Top = 4 
     Width = 473 
     Height = 21 
     BevelOuter = bvNone 
     Caption = 'pDisp2' 
     Font.Charset = DEFAULT_CHARSET 
     Font.Color = clWindowText 
     Font.Height = -11 
     Font.Name = 'Tahoma' 
     Font.Style = [] 
     ParentFont = False 
     TabOrder = 0 
     object Label18: TLabel 
      Left = 1 
      Top = 4 
      Width = 8 
      Height = 13 
      Caption = 'llll' 
      Font.Charset = DEFAULT_CHARSET 
      Font.Color = clWindowText 
      Font.Height = -11 
      Font.Name = 'Tahoma' 
      Font.Style = [] 
      ParentFont = False 
     end 
     object DBEdit29: TDBEdit 
      Left = 51 
      Top = 0 
      Width = 421 
      Height = 21 
      TabStop = False 
      Color = clBtnFace 
      Ctl3D = True 
      DataField = 'Name' 
      Font.Charset = DEFAULT_CHARSET 
      Font.Color = clBlack 
      Font.Height = -11 
      Font.Name = 'MS Sans Serif' 
      Font.Style = [] 
      ParentCtl3D = False 
      ParentFont = False 
      ReadOnly = True 
      TabOrder = 0 
     end 
     end 
    end 
    end 
    object ts1: TTabSheet 
    Caption = 'ts1' 
    Font.Charset = DEFAULT_CHARSET 
    Font.Color = clWindowText 
    Font.Height = -11 
    Font.Name = 'Tahoma' 
    Font.Style = [] 
    ParentFont = False 
    object shp1: TShape 
     Left = 48 
     Top = 32 
     Width = 521 
     Height = 201 
    end 
    object Shape1: TShape 
     Left = 120 
     Top = 104 
     Width = 377 
     Height = 81 
    end 
    end 
end 
Verwandte Themen