Autor Beitrag
elzer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Sa 25.10.08 15:35 
Hi Leute, ist es möglich von einer ProgressBar.Position auf ButtonClick z.B. 25% abziehen zu lassen?
Habe selbst schon probiert aber da ich mit:
ausblenden Delphi-Quelltext
1:
ProgressBar1.Position:=ProgressBar1.Position*(25/100)  //oder -25%					

einen Integer Wert abziehen will (und 25/100 bzw 25%, keine sind) fällt mir keine weitere Möglichkeit ein; habe auch die Suchfunktion ohne Erfolg benutzt.
Danke für eure Hilfe :)
Elzer

Edit: Rechtschreibfehler


Zuletzt bearbeitet von elzer am Sa 25.10.08 15:58, insgesamt 1-mal bearbeitet
pigfacejoe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 332
Erhaltene Danke: 1

Win 10, Ubuntu
Delphi,Javascript, PHP, Java, Python
BeitragVerfasst: Sa 25.10.08 15:44 
25% entspricht 1/4 der Progressbar.Position.
=> progressbar1.position:=progressbar.position-(progressbar1.position div (100 div p%));
Bei dir:progressbar1.position:=progressbar.position-(progressbar1.position div (100 div 25));
Gruß
Max
elzer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Sa 25.10.08 15:58 
Danke es geht =)
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 25.10.08 16:05 
Da waren nur zwei kleine Fehler in deinem Quelltext:
ausblenden Delphi-Quelltext
1:
ProgressBar1.Position:=round(ProgressBar1.Position*(75/100))					

Zum einen muss man das ganze auf die nächste ganze Zahl runden, und zum anderen musst du nicht das nehmen was wegkommt, sondern das was noch bleibt.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Sa 25.10.08 17:03 
ausblenden Statt / und Round sollte aber schon:
1:
ProgressBar1.Position := ProgressBar1.Position * 75 div 100;					


mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
elzer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Sa 25.10.08 20:15 
Danke =) hat funktioniert