AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi selbsterstellte Combobox hat (noch) keinere Fehler
Thema durchsuchen
Ansicht
Themen-Optionen

selbsterstellte Combobox hat (noch) keinere Fehler

Ein Thema von David Martens · begonnen am 8. Jun 2010 · letzter Beitrag vom 17. Jun 2010
Antwort Antwort
David Martens

Registriert seit: 29. Sep 2003
205 Beiträge
 
Delphi XE Enterprise
 
#1

AW: selbsterstellte Combobox hat (noch) keinere Fehler

  Alt 15. Jun 2010, 16:37
So:

Delphi-Quellcode:
procedure TMultiColCheckedComboBox.DoDropDown(Sender : TObject);
var
  ScreenPoint : TPoint;
  i, j,
  FWidth,
  FHeight,
  FTop,
  FLeft : integer;
begin
  // damit das Suchfeld nicht unerwartet aufpoppt, wird es beim Zeigen der
  // CheckList immer auf unsichtbar geschaltet
  if FSearchForm.Visible then
  begin
    FSearchForm.Visible := false;
  end;

  if FMultiSearchForm.Visible then
  begin
    FMultiSearchForm.Visible := false;
  end;

  // Dropdownbutton
  if FButton.Tag = 1 then
  begin
    FButton.Tag := 0;
    if not FEdit.Focused then
      EditOnExit(Sender);
    Exit;
  end;

  Click;

  // Assign Form coordinate and show
  ScreenPoint := Parent.ClientToScreen(Point(Self.Left, Self.Top + Self.Height));

  with FPrivForm do
  begin
    Visible := false;
    FLeft := ScreenPoint.X;
    FTop := ScreenPoint.Y;
    FWidth := 0;
    FHeight := 0;

    // Gesamtbreite des Grids ermitteln
    ...
    // Aufklapphöhe ermitteln (keine leere Fläche in der DropDownBox)
    ...
    // Breite mindestend Komponentenbreite
    ...
    // Höhe auf Bildschirmgröße limitieren
    ...
    // Breite auf Bildschirmgröße limitieren
    ...

    BorderStyle := bsNone;
    OnDeactivate := DoCloseDropDown;

    // Box anzeigen
    Show;
    SetBounds(FLeft, FTop, FWidth, FHeight);
    FormStyle := fsStayOnTop; // über die Startleiste
    Font := Self.Font;
  end;
end;
  Mit Zitat antworten Zitat
Alaitoc

Registriert seit: 24. Okt 2008
263 Beiträge
 
Delphi 7 Enterprise
 
#2

AW: selbsterstellte Combobox hat (noch) keinere Fehler

  Alt 17. Jun 2010, 07:43
Danke Dir, werde nun im Laufe des Tages schauen was ich anders gemacht habe.
Wahrscheinlich so gegen Mittag...

MfG Alaitoc
  Mit Zitat antworten Zitat
Alaitoc

Registriert seit: 24. Okt 2008
263 Beiträge
 
Delphi 7 Enterprise
 
#3

AW: selbsterstellte Combobox hat (noch) keinere Fehler

  Alt 17. Jun 2010, 16:28
Ich finde es ehrlich gesagt einfach nicht...die einzigen Einstellungen die ich an meinem Fenster vornehme sind diese hier:

Code:
// Im Create
DesktopWindow:= TForm.Create(Self);
DesktopWindow.Parent := Self;

// In der Initialisierung
// Initialisieren des Desktop-Fensters
DesktopWindow.DoubleBuffered := True;
DesktopWindow.AutoSize := True;
DesktopWindow.DefaultMonitor := dmDesktop;

// Setzt als Parent das Desktop-Handle
Windows.SetParent( DesktopWindow.Handle , GetDesktopWindow() );

// WS_EX_TOOLWINDOW
// Window with a thin caption. Does not appear in the taskbar or in the Alt-Tab palette. WS_CAPTION also must be specified.
SetWindowLong( DesktopWindow.Handle, GWL_EXSTYLE, ( GetWindowLong( DesktopWindow.Handle, GWL_EXSTYLE ) or WS_EX_TOOLWINDOW ) );
// And NOT
// WS_THICKFRAME
// Window with no Border.
SetWindowLong( DesktopWindow.Handle, GWL_STYLE, ( GetWindowLong( DesktopWindow.Handle, GWL_STYLE ) and not WS_THICKFRAME ) ) ;
// And NOT
// WS_CAPTION
// Window that has a title bar (automatically includes the WS_BORDER if no other border style is specified).
SetWindowLong( DesktopWindow.Handle, GWL_STYLE, ( GetWindowLong( DesktopWindow.Handle, GWL_STYLE) and not WS_Caption ) );
Die Komponente wird dabei von TCustomPanel abgeleitet.
Änderst du vll. iwas spezielles an deinem Formular, vll. liegts auch an fsStayOnTop?

MfG Alaitoc
  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 18:30 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