Autor Beitrag
wolle-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 30.01.05 01:34 
:?: Hallo zusammen!
Habe noch ein paar 'kleine' Probleme, ich fang mal an! Also ich wollte eigentlich *doppelklick auf admintool.exe*, nun startet ein Dialog wo ich username + password eingebe :

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
procedure TAboutBox4.Button1Click(Sender: TObject);
type
  TLoginData = record
    Username: String;
    Password: String;
  end;
const
  LoginData: array[0..1] of TLoginData = (
    (Username : 'wolle'; Password : 'test'),
    (Username : 'PeterLustig'; Password : '666'));
var
  I: Integer;
  CanLogin: Boolean;
begin


  CanLogin := False;


  for I := Low(LoginData) to High(LoginData) do
    if Edit1.Text = LoginData[I].Username then
    begin
      if Edit2.Text = LoginData[I].Password then
        CanLogin := True;
      Break;
    end;


  if CanLogin then
ShowWindow(Form1.Handle, SW_SHOW)
  else
   Label4.Caption := 'Du darfst hier nicht rein.';


end;


So Nun gebe ich Username + Password ein, alles was passiert ist das sich die Hauptform zwar aufbaut, aber keine Dialoge bzw buttons oder ähnliches da ist!!
Irgendwas mache ich doch heftig falsch oder?

Danke für die hilfe!

Mfg Wolle

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconraziel: Topic aus Windows API verschoben am So 30.01.2005 um 08:30
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 30.01.05 15:39 
Weiss das denn wirklich niemand? :-(
kiwicht
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: So 30.01.05 15:45 
Hallo Wolle-


mich irritiert: "ShowWindow(Form1.Handle, SW_SHOW)"

Die Form, die da aufgerufen werden soll, wird die bei Applikations-Start automatisch "erstellt"?

Mein Tip: Form1 nicht automatisch erstellen lassen, und dann anstatt deines "ShowWindow..." folgende Zeile:
ausblenden Delphi-Quelltext
1:
2:
Form1 := TForm1.Create(Self);
Form1.Show;


Fertig :)

ki

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 30.01.05 17:26 
ja nur mit den ; abschliessen kommt dann immer

[Fehler] psw.pas(64): ';' nicht erlaubt vor einem 'ELSE'
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 30.01.05 17:29 
Und was sagt uns das wohl? :?

Wahrscheinlich das ; nicht erlaubt ist vor else :lol: also lässt man es am besten weg...
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 30.01.05 17:30 
so schlau war ich ja auch!!!

ausblenden Delphi-Quelltext
1:
[Fehler] psw.pas(64): 'END' erwartet, aber 'ELSE' gefunden					

;)

Und irgendwie funzt dann die else funktion nicht mehr wenn ich da ein end; einfüge :|
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 30.01.05 17:37 
So muss es aussehen...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
 if CanLogin then   
  begin
   Form1 := TForm1.Create(Self);   
   Form1.Show
  end
   else   
    Label4.Caption := 'Du darfst hier nicht rein.';


ps.: Copy & Paste bringt garnichts...
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 30.01.05 17:39 
genial Danke! Ihr seid die besten!!!

Bin halt noch anfänger, jeder lernt dazu ;-)