AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi ComboBox nach TabStop True/False Text markiert

ComboBox nach TabStop True/False Text markiert

Ein Thema von Eppos · begonnen am 17. Aug 2022 · letzter Beitrag vom 17. Aug 2022
Antwort Antwort
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.748 Beiträge
 
Delphi 12 Athens
 
#1

AW: ComboBox nach TabStop True/False Text markiert

  Alt 17. Aug 2022, 13:06
Ohh, das ist komischt.

Mit Items in den ComboBoxen, passiert das wirklich
ohne Items nicht.

Der DropDown geht ja garnicht auf
und ich wäre davon ausgegangen "Text ist Text", da im Edit,
vor allem da ItemIndex ja -1 und somit garnkein Item aktiv ist.






Ein Darstellungsfehler, beim Ändern, scheint es auxch nicht zu sein.
Self.Repaint, sowie ComboBox2.Repaint ändern nichts,
aber, wie gesagt:

Delphi-Quellcode:
procedure TForm21.Button1Click(Sender: TObject);
begin
  ComboBox1.TabStop := False;
  ComboBox1.TabStop := True;

  ComboBox2.TabStop := False;
  ComboBox2.TabStop := True;
  ComboBox2.SelLength := 0;
end;
Ein Therapeut entspricht 1024 Gigapeut.

Geändert von himitsu (17. Aug 2022 um 13:09 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.748 Beiträge
 
Delphi 12 Athens
 
#2

AW: ComboBox nach TabStop True/False Text markiert

  Alt 17. Aug 2022, 13:47
Am TabStop selber liegt es garnicht.

Irgendwas im SetWindowLong(GWL_STYLE) bringt das Control durcheinander.


Ob es jetzt an Windows oder irgendwas in der VCL liegt, konnte ich nicht entdecken.
(mit Debug-DCUs bissl durch die VCL und auf die Schnelle nichts bemerkt)


Man könnte jetzt noch mit anderen Sprachen (C++ oder so) das testen,
bzw. mal eine NonVCL-ComboBox erstellen und auch dort schauen.



Aus TComboBox.SetTabStop den relevanten Code rausgeholt und Zeilen einzeln getestet und unwichtiges auskommentiert:
Delphi-Quellcode:
{ ComboBox2.TabStop := Value; }
//PBoolean(@ComboBox2.TabStop)^ := Value;
Style := GetWindowLong(ComboBox2.Handle, GWL_STYLE) {and not WS_TABSTOP};
//if Value then Style := Style or WS_TABSTOP;
SetWindowLong(ComboBox2.Handle, GWL_STYLE, Style);
//ComboBox2.Perform(CM_TABSTOPCHANGED, 0, 0);
Delphi-Quellcode:
Style := GetWindowLong(ComboBox2.Handle, GWL_STYLE);
SetWindowLong(ComboBox2.Handle, GWL_STYLE, Style); // das hier ist Schuld

siehe
Delphi-Quellcode:
procedure TWinControl.SetTabStop(Value: Boolean);
var
  Style: NativeInt;
begin
  if FTabStop <> Value then begin
    FTabStop := Value;
    if HandleAllocated then begin
      Style := GetWindowLong(WindowHandle, GWL_STYLE) and not WS_TABSTOP;
      if Value then Style := Style or WS_TABSTOP;
      SetWindowLong(WindowHandle, GWL_STYLE, Style);
    end;
    Perform(CM_TABSTOPCHANGED, 0, 0);
  end;
end;
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.748 Beiträge
 
Delphi 12 Athens
 
#3

AW: ComboBox nach TabStop True/False Text markiert

  Alt 17. Aug 2022, 14:00
Delphi-Quellcode:
type
  TForm1 = class(TForm)
    ...
  private
    ComboBox3: HWND;
  end;


implementation

uses
  Winapi.CommCtrl;

procedure TForm1.Button1Click(Sender: TObject);
var
  Style: Integer;
begin
   ...

  Style := GetWindowLong(ComboBox3, GWL_STYLE);
  SetWindowLong(ComboBox3, GWL_STYLE, Style);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ComboBox3 := CreateWindowEx(0, WC_COMBOBOX, '', WS_VSCROLL or CBS_HASSTRINGS or CBS_AUTOHSCROLL
    or CBS_DROPDOWN or WS_CHILD or WS_OVERLAPPED or WS_VISIBLE,
    ComboBox2.Left, ComboBox2.Top+30, ComboBox2.Width, ComboBox2.Height,
    Self.Handle, 0, HInstance, 0);
  SendTextMessage(ComboBox3, CB_ADDSTRING, 0, 'ComboBox3');
  SetWindowText(ComboBox3, 'ComboBox3');
end;
Liegt dann wohl nicht an der Delphi-VCL.
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Antwort Antwort

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

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 15:55 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