Autor Beitrag
Jakane
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 257



BeitragVerfasst: Do 19.09.13 10:19 
Hallo liebe Delphi-Helfer :)

meine Progressbar ist und bleibt grün egal was ich mache :(

ausblenden Delphi-Quelltext
1:
2:
3:
4:
PostMessage(PB.Handle, $04090, clRed);
SendMessage(PB.Handle, $04090, clRed);
PB.BarColor := clRed;
PB.Perform($04090, clRed);


Die XE4 Hilfe ist auch zum **** xD

Hoffe jemand weiss rat ^^

_________________
Die Welt besteht aus Zahlen, also ist alles möglich.
[Delphi 5] - [Delphi XE5]
baumina
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 305
Erhaltene Danke: 61

Win 7
Delphi 10.2 Tokyo Enterprise
BeitragVerfasst: Do 19.09.13 10:41 
Das liegt an der Projekt-Einstellung "Laufzeit-Themes aktivieren". Entweder Du deaktivierst das ganz für dein Projekt unter "Projekt/Optionen/Anwendung" oder nur für die Progressbar z.B. im FormShow folgendermaßen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
uses uxTheme

if uxTheme.IsThemeActive then
begin
  uxTheme.SetWindowTheme(PB.Handle, '''');
end;

Für diesen Beitrag haben gedankt: Jakane
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 19.09.13 11:40 
XPMAN entfernen.
Jakane Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 257



BeitragVerfasst: Do 19.09.13 12:34 
Na wenn ich soweit gehe bringt mich mein Chef um :D

Aber danke für die Info :)

_________________
Die Welt besteht aus Zahlen, also ist alles möglich.
[Delphi 5] - [Delphi XE5]
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 19.09.13 17:21 
Laut den Design Guidelines für Windows hat die Farbe der Progressbar eine Bedeutung und sollte situationsgerecht genutzt werden (macht finde ich wie angegeben auch Sinn):
msdn.microsoft.com/e...esktop/aa511486.aspx hat folgendes geschrieben:
Progress bar colors
Use red or yellow progress bars only to indicate the progress status, not the final results of a task. A red or yellow progress bar indicates that users need to take some action to complete the task. If the condition isn't recoverable, leave the progress bar green and display an error message.

Turn the progress bar red when there is a user recoverable condition that prevents making further progress. Display a message to explain the problem and recommend a solution.

Turn the progress bar yellow to indicate either that the user has paused the task or that there is a condition that is impeding progress but progress is still taking place (as, for example, with poor network connectivity). If the user has paused, change the Pause button label to Resume. If progress is impeded, display a message to explain the problem and recommend a solution.

Setzen kannst du diesen Status dann entsprechend:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
const
  PBM_SETSTATE = WM_USER + 16;
  PBM_GETSTATE = WM_USER + 17;

  PBST_NORMAL = $0001;
  PBST_ERROR = $0002;
  PBST_PAUSED = $0003;
begin
  ProgressBar1.Perform(PBM_SETSTATE, PBST_ERROR, 0); // Fehler, den der User durch eine Aktion korrigieren kann
  ProgressBar1.Perform(PBM_SETSTATE, PBST_PAUSED, 0); // Rückfrage vom User muss für den weiteren Fortschritt beantwortet werden