Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi VirtualTreeView (VST) : Header Option coVisible abfragen (https://www.delphipraxis.net/175262-virtualtreeview-vst-header-option-covisible-abfragen.html)

Piro 10. Jun 2013 09:10

VirtualTreeView (VST) : Header Option coVisible abfragen
 
Moin zusammen,

irgendwie bekomme ich nicht die Option coVisible abgefragt. Möchte gerne den Wert True oder False ermitteln, um es zu speichern.

Mit folgendem Code, kann ích die Option setzen.
Delphi-Quellcode:
ColumnIndex := 1;
 case Ord(cb_setup_computername.Checked) of
   0: vst_overview.Header.Columns[ColumnIndex].Options := vst_overview.Header.Columns[ColumnIndex].Options - [coVisible];
   1: vst_overview.Header.Columns[ColumnIndex].Options := vst_overview.Header.Columns[ColumnIndex].Options + [coVisible];
 end;
Nur abfragen gelingt mir nicht. Habe auch schon folgendes versucht aber ohne erfolgt.
Delphi-Quellcode:
var
 ColumnVisible : Boolean;
...
ColumnVisible := vst_requests.Header.Columns[i].Options[coVisible];
Wäre sehr dankbar für einen Gedankenanstoß.

MfG
Sven

Lemmy 10. Jun 2013 09:16

AW: VirtualTreeView (VST) : Header Option coVisible abfragen
 
Hi,

ein

Delphi-Quellcode:

ColumnVisible := coVisible in vst_requests.Header.Columns[i].Options;
geht nicht?

Piro 10. Jun 2013 09:54

AW: VirtualTreeView (VST) : Header Option coVisible abfragen
 
Cool.

Danke.

uligerhardt 10. Jun 2013 10:09

AW: VirtualTreeView (VST) : Header Option coVisible abfragen
 
Zitat:

Zitat von Piro (Beitrag 1218000)
Delphi-Quellcode:
ColumnIndex := 1;
 case Ord(cb_setup_computername.Checked) of
   0: vst_overview.Header.Columns[ColumnIndex].Options := vst_overview.Header.Columns[ColumnIndex].Options - [coVisible];
   1: vst_overview.Header.Columns[ColumnIndex].Options := vst_overview.Header.Columns[ColumnIndex].Options + [coVisible];
 end;

Wäre
Delphi-Quellcode:
ColumnIndex := 1;
if cb_setup_computername.Checked then
  vst_overview.Header.Columns[ColumnIndex].Options := vst_overview.Header.Columns[ColumnIndex].Options + [coVisible]
else
  vst_overview.Header.Columns[ColumnIndex].Options := vst_overview.Header.Columns[ColumnIndex].Options - [coVisible];
end;
nicht lesbarer?

Oder noch besser
Delphi-Quellcode:
ColumnIndex := 1;
Col := vst_overview.Header.Columns[ColumnIndex];
if cb_setup_computername.Checked then
  Col.Options := Col.Options + [coVisible]
else
  Col.Options := Col.Options - [coVisible];
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:06 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