Autor Beitrag
bruce185
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Fr 07.07.06 22:30 
hallo,
also ich habe ein Programm geschrieben wo man sich registrieren muss, und wenn ich auf den Button Klicke um zu Registrieren, dann soll Button3.Visible auf false gesetzt werden und gespeichert werden, hier mal der code:

in Registry Speichern:

ausblenden Delphi-Quelltext
1:
regist.WriteBool('RegistrierungsButton',Form2.Button3.Visible);					


und hier wieder auslesen:

ausblenden Delphi-Quelltext
1:
Button3.Visible := regist.ReadBool('RegistrierungsButton');					


wisst ihr vieleicht was ich da falsch gemacht habe?
weil wenn ich das Programm erneut starte, dann ist der Button immer noch auf true :(

danke euch schonmal für die hilfe :wink:

Gruss Andreas
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Fr 07.07.06 22:33 
Kannst du bitte mal den gesamten Code posten, den du benutzt, wenn du mit der Registry arbeitest?

_________________
Programmers never die, they just GOSUB without RETURN
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Fr 07.07.06 22:40 
aso sry,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
regist:=TRegistry.Create;
regist.RootKey:=HKEY_CURRENT_USER;
regist.OpenKey('Software\Progs\Test', true);

regist.WriteBool('RegistrierungsButton',Form2.Button3.Visible);

regist.free;


also mehr hab ich net :wink:

Gruss Andreas
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 07.07.06 22:48 
Hast du Form2.Button3.Visible vorher schon auf False gesetzt?

_________________
Markus Kinzler.
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Fr 07.07.06 23:02 
hallo,

also des is die ganze zeit auf true gesetzt, es soll auf false gesetzt werden sobald ich auf den button klicke und soll anschließend ins registry gespeichert werden.

Gruss Andreas
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 07.07.06 23:05 
Dann mußt du es auch setzen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
regist:=TRegistry.Create;
regist.RootKey:=HKEY_CURRENT_USER;
regist.OpenKey('Software\Progs\Test', true);
Form2.Button3.Visible := False;
regist.WriteBool('RegistrierungsButton',Form2.Button3.Visible);

regist.free;

_________________
Markus Kinzler.
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Fr 07.07.06 23:08 
das weiss ich, aba wenn ich es wieder auslesen möchte mit ReadBool, also wenn das Programm erneut gestartet wird dann geht das nicht, es ist dann wieder auf true, woran kann das liegen?

edit: aso jetzt funktioniert das, es hat nur an das hier gelegen:
ausblenden Delphi-Quelltext
1:
Form2.Button3.Visible := false;					


ich danke dir für deine hilfe :D

Gruss Andreas
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 07.07.06 23:10 
In welcher Methode liest du die Registry aus?

_________________
Markus Kinzler.
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Fr 07.07.06 23:12 
also es funktioniert jetzt, danke dir für deine hilfe :D
hab net gewusst das man es erst auf false setzen muss bevor man es speichert.

Gruss Andreas