Autor Beitrag
PP-deluxe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 29.01.06 15:49 
Hallo,
kann mir jemand sagen, wie man eine Warnung ausgibt, wenn kein Radiobutton ausgewählt wurde (ist ja immer vom Typ Boolean)?

ThX

Moderiert von user profile iconChristian S.: Titel geändert.
Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 29.01.2006 um 15:54
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 29.01.06 15:54 
meinst du sowas? :roll:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
begin
  if radiobutton1.Checked = false then
   if radiobutton2.Checked = false then
    if radiobutton3.checked = false then
     begin showmessage('Bitte wählen Sie eine Option aus!')
      end else
       begin
        [...]
  end;
 end;
end.
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 29.01.06 16:04 
Hallo,

oder schon zur Entwicklungszeit im OI eine sinnvolle Voreinstellung vornehmen und einen der Radio-Buttons auf Checked = True setzen, dann erübrigt sich die Überprüfung.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
PP-deluxe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 29.01.06 16:19 
sieht schon mal gut aus, aber ich habe das ganze mit einer RadioGroup und dann mit den Items im Objektinspektor eingetragen.

Wie würde dafür die Lösung lauten ?

Und wenn was makriert worden ist, wie kann man den Punkt in dem Button wieder aufheben=?

ThX
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: So 29.01.06 16:24 
Für alle Radiobutton folgenden Befehl verwenden:
ausblenden Delphi-Quelltext
1:
checked:=false;					
PP-deluxe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 29.01.06 16:35 
ja danke das funtkioniert, aber leider nicht in der Radiogroup, weil ich ja die Buttons über Item eingetragen habe :(

Wäre für den letzten Schups noch dankbar

Und big ThX für eure Schnelligkeit!


//Edit

RadioGroup1.ItemIndex := -1;

ist die Lösung, trotzdem danke für alles!
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Mo 30.01.06 14:17 
Auf untergeordnete Elemente in einer Radiogroup greift man zu wie wie untergeortnete Teile von z.B. einer klasse oder Record.
ausblenden Delphi-Quelltext
1:
radiogroup1.radiobutton1.checked:=false					
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: Mo 30.01.06 19:51 
Hallo,
seit wann geht denn das :gruebel:

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 30.01.06 19:56 
user profile iconLannes hat folgendes geschrieben:
Hallo,
seit wann geht denn das :gruebel:


Das kenn ich so auch nicht.

Mit radiogroup1.itemindex kannst du bestimmen, was ausgewählt ist.

Zum Beispiel:

ausblenden Delphi-Quelltext
1:
2:
//ersten Eintrag wählen
radiogroup1.itemindex:=0;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mo 30.01.06 20:38 
er meinte wohl das hier: ;)
ausblenden Delphi-Quelltext
1:
radiogroup1.Buttons[0].Checked := true;					
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: Mo 30.01.06 20:40 
Hallo,
außerdem würde das den Umgang mit Klassen und Records ad adsurdum führen.
Wenn dem so wäre könnte man auf untergeordnete Teile nur so zugreifen,
Zugriff per Schleife ist dann nicht möglich:
ausblenden Delphi-Quelltext
1:
2:
3:
radiogroup1.radiobutton1.checked:=false;
radiogroup1.radiobutton2.checked:=false;
radiogroup1.radiobutton3.checked:=false;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )