AGB  ·  Datenschutz  ·  Impressum  







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

Scrollbars

Ein Thema von Bjoerk · begonnen am 3. Mär 2012 · letzter Beitrag vom 3. Mär 2012
 
Bjoerk

Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
 
Delphi 10.4 Sydney
 
#9

AW: Scrollbars

  Alt 3. Mär 2012, 14:50
Ja, ich weiß, ihr habt da alle Recht. Mich bitte auch jetzt nicht falsch verstehen. Ich hab meine Gründe, warum ich das so frage. Normalerweise arbeite ich constraints usw., zur Not mit einer Scrollbox und fertig. Ich hab‘ ca. 100 Forms, bei denen das so ist, wie oben beschrieben. Wenn ich da jetzt anfange zu ändern, wird‘ ich nie mehr fertig. Dann hab ich in OnResize auch noch einiges stehen. Meine Notlösung sah bis bisher so aus:

Delphi-Quellcode:
procedure MainFormPaint;
var
  ATop, ALeft, AWidth, AHeight, SWidth, SHeight, SLeft, STop, T: integer;
begin
  ALeft:= Application.MainForm.Left;
  ATop:= Application.MainForm.Top;
  AWidth:= Application.MainForm.Width;
  AHeight:= Application.MainForm.Height;

  SWidth:= Screen.WorkAreaWidth;
  SHeight:= Screen.WorkAreaHeight;
  STop:= Screen.WorkAreaTop;
  SLeft:= Screen.WorkAreaLeft;

  if ((SWidth-AWidth) < 0) or ((SHeight-AHeight) < 0) then
  begin
    Application.MainForm.HorzScrollBar.Range:= AWidth;
    Application.MainForm.VertScrollBar.Range:= AHeight;
    AWidth:= SWidth;
    AHeight:= SHeight;
  end;

  T:= ALeft;
  while (T+SLeft+AWidth) > SWidth do Dec(T);
  if T < SLeft then T:= SLeft;
  ALeft:= T;

  T:= ATop;
  while (T+STop+AHeight) > SHeight do Dec(T);
  if T < STop then T:= STop;
  ATop:= T;

  Application.MainForm.SetBounds(ALeft, ATop, AWidth, AHeight);
end;
  Mit Zitat antworten Zitat
 


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 05:05 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz