Autor Beitrag
N47R0N
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Do 26.05.05 02:07 
Hi

Also ich habe Einen Chat gebastelt in dem wenn man oben in der leiste noch einen Button hat mit dem man noch einige Einstellungen vornehmen kann z.B Schriftfarbe

Wenn man den betätigt öffnet sich meine 2te Form dort kann man sich 4 Farben aussuchen

( RadioButton1 ) Rot

( RadioButton2 ) Schwarz

( RadioButton3 ) Grün

( RadioButton4 ) Gelb

1. Wie bekomme ich das hin das von der Form2 aus die Einstellungen auch auf die Form1 übergehen ???

2. Wie lautet der befehl in dem man fragt ob ein RadioButton ausgewählt ( nicht ausgewählt ) ist ???

Das sind bestimmt dumme fragen doch ich komme in der hinsicht echt nicht weiter danke an alle die mir helfen .


Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am Do 26.05.2005 um 15:11


Zuletzt bearbeitet von N47R0N am Do 26.05.05 02:35, insgesamt 1-mal bearbeitet
Pr0g
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Do 26.05.05 02:22 
Also mit RadioButton1.Checked kommst du den Status raus, also ob angewählt, oder nicht. Und die Farbe lässt sich am besten im ShowModal übergeben. Hab mal nen kleines Beispiel angehangen.

MfG Pr0g
Einloggen, um Attachments anzusehen!
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Do 26.05.05 02:41 
Das ganse funktioniert irgendwie nicht .

Ich will das wenn ich auf Form2 den RadioButton1 ( Schwarz ) auswähle dann die schriftfarbe im Memo1 auf Form1 auch schwarz wird wenn ich die Einstellungsplattform auf Form2 mit OK verlassen habe .
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Do 26.05.05 05:53 
Wo liegt bei dir das Problem? Beim Übergeben zwischen Formularen oder allgemein bei der Checkbox, wie man mit ihr umgeht?
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 26.05.05 07:05 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure Radiobuttonschwarzclick(Sender: TObject);
begin
if Radiobuttonschwarz.checked then  //is unnötig da wenn drauf geklickt wird automatisch checked auf true geht.
  begin
  Form1.label1.font.color := clblack;
  end;
end;
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Do 26.05.05 11:47 
BIG THX

Ich habs verstanden :D :D :D :D
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 26.05.05 12:58 
Setzt auch du noch bitte den Status des Topic auf beantwortet?
ThePriest
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Sa 15.10.05 18:03 
Titel: Noch eine Frage zum Thema RadioButton
Ich habe folgenden Code der nun ausführen soll, dass wenn alle RadioButtons nicht gecheckt sind, der User die Mitteilung erhält 'Wähle bitte ein Level aus'. Nun hat sich da ein Fehler eingeschlichen, der verursacht das bei RBTN_level1.checked (=RadioButton1) auch die Message kommt. Nun dies ist von mir nicht beabsichtigt, da die Meldung nur kommen soll wenn keiner gechecked ist. Wäre dankbar für jede Hilfe ! MfG
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TFRM_zahlenraten.BTN_auswertenClick(Sender: TObject);
begin

if not (RBTN_level1.Checked) and (RBTN_level2.Checked) or (RBTN_level3.Checked)
 then
 auswerten
  else
   Application.MessageBox ('Wähle bitte ein Level aus !', 'Levelauswahl',16);
end;
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 15.10.05 18:20 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TFRM_zahlenraten.BTN_auswertenClick(Sender: TObject);
begin

if (RBTN_level1.Checked=false) and (RBTN_level2.Checked=false) and (RBTN_level3.Checked=false)
 then
 auswerten
  else
   Application.MessageBox ('Wähle bitte ein Level aus !', 'Levelauswahl',16);
end
ThePriest
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Sa 15.10.05 18:48 
Wenn ich den Code so wie vorgeschlagen verbessere rückt das selbe Problem zum RadioButton2 und RadioButton3. Sobald ein Radiobutton gechecked ist, soll die Message 'Wähle bitte ein Level aus' nicht mehr kommen.
(Hab da echt ein Brett vorm Kopf....sorry ;-) )
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 15.10.05 19:04 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if (CheckBox1.Checked = false) and (CheckBox2.Checked = false) and
(CheckBox3.Checked = false) then
  showmessage('level auswählen')
  else
  showmessage('werte aus');
Pardon, hatte dich falsch verstanden. Ich stand auch auf der Leiutng, aber das müsste das sein was du willst.
ThePriest
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: So 16.10.05 11:24 
Mhhh wenn ich and anstatt or setze, will er die Rechnung auswerten gar net mehr ausführen...

Ich glaube ich poste mal den Quelltext der vieleicht noch zur Problemlösung beitragen kann
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:
procedure TFRM_zahlenraten.auswerten;
var gerzahl : byte;  //lokale Deklaration
begin
 if not (EDT_eingabe.Text='')                   //Verhindert das Auswerten beginnt Zeichen im EDT_eingabe
  then begin
  gerzahl := StrToInt (EDT_eingabe.Text);
  if gerzahl = zufzahl
    then LBL_rateergebnis.caption := 'Die Zahl wurde erraten'
    else
      begin
        if gerzahl < zufzahl
          then LBL_rateergebnis.caption := 'Die Zahl ist zu klein'
          else LBL_rateergebnis.caption := 'Die Zahl ist zu groß';
        EDT_eingabe.clear;
        EDT_eingabe.SetFocus;
    end;  //else
  end;
end;




procedure TFRM_zahlenraten.BTN_auswertenClick(Sender: TObject);
begin

if not (RBTN_level1.Checked) and (RBTN_level2.Checked) or (RBTN_level3.Checked)
 then
 auswerten
  else
   Application.MessageBox ('Wähle bitte ein Level aus !', 'Levelauswahl',16);
end;


Nun soll wie gesagt die Message 'Wähle bitte ein Level aus' nur
kommen, wenn kein RadioButton gechecked ist. Sobald einer gechecked ist, soll die Rechnung auswerten normal weiter geführt werden.

Naja trotzdem schonmal danke das ihr euch meinem Problem angenommen habt !
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 16.10.05 12:19 
Hallo,
user profile iconFabian W. hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
if (CheckBox1.Checked = false) and (CheckBox2.Checked = false) and (CheckBox3.Checked = false) then					

Du hast folgendes:
user profile iconThePriest hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
if not (RBTN_level1.Checked) and (RBTN_level2.Checked) or (RBTN_level3.Checked) then					

user profile iconFabian W. prüft auf False, Du prüfst auf True und nutzt außerdem not.


Entweder nimmst Du den Code von Fabian, oder wenn Du auf True prüfen willst, folgendes:
ausblenden Delphi-Quelltext
1:
if (CheckBox1.Checked) or (CheckBox2.Checked) or (CheckBox3.Checked) then					

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
ThePriest
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: So 16.10.05 12:32 
Titel: gelöst
Vielen Dank ! Danke Fabian W. und Lannes !
Beide Lösungen haben mir echt geholfen zu verstehen was falsch war !