ERLEDIGT
NEIN
NEIN
ANTWORTEN
3
3
ZUGRIFFE
3739
3739
EMPFEHLEN
-
Hey Leute!
Bin seit grade eben neu hier, habe gesehn, dass sich hier einige erfahrene Programmierer tummeln und da dacht ich mir, dass mir hier bestimmt geholfen werden kann
Vorweg: Ich bin Anfänger und lerne gerade in der Schule zu "programmieren"
Also zu meinem Problem:
Ich habe ein Programm zum Erstellen und Auflisten von FussballTipps. Anzugeben und auszuwählen sind Vorname/Nachname ( in je 2 Edit-Fenstern ), Tipp Gastmannschaft und Tipp Heimmannschaft ( in je 2 Edit-Fenstern ) und die Paarung der Mannschaften ( in einer ComboBox ). Zusätzlich gibt es einen Button, den man zum Speichern des Tipps in einem StringGrid betätigen kann.
Nun habe ich schon weitesgehend alles fertig programmiert und wollte das Programm, da ich es morgen abgeben muss, ein wenig aufpolieren und ein paar kleine Details einbauen.
Dann habe ich mir überlegt eine MessageBox mit einer Ja/Nein Abfrage für den Button einzubauen, ob man sich wirklich sicher sei, den Tipp abgeben zu wollen!
Es wäre wirklich super, wenn mir jemand in irgendeiner Weise noch bis morgen erklärt kriegt wie ich solch eine Abfrage da zwischenschalte!
Um das Ganze ein wenig deutlicher zu machen hier ein Bild der graphischen Oberfläche und ein Auszug aus dem Quelltext des bisherigen Programms:
Bild:
http://img91.imageshack.us/my.php?im...alltippge9.jpg
Quelltext:
Code :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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Fussball2.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; AnsiString VName, NName; float TippH, TippG; int j,i=1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { StringGrid->Cells[0][0] = " Nr. "; StringGrid->Cells[1][0] = " - Tipper - "; StringGrid->Cells[2][0] = " - Paarung - "; StringGrid->Cells[3][0] = " - Tipp - "; for ( j=1; j<=51; j++ ) { StringGrid->Cells[0][j] = " "+FloatToStr(j)+"."; } } //--------------------------------------------------------------------------- void __fastcall TForm1::EditVNameChange(TObject *Sender) { VName = ( EditVName->Text ); } //--------------------------------------------------------------------------- void __fastcall TForm1::EditTippHChange(TObject *Sender) { TippH = StrToFloat ( EditTippH->Text ); } //--------------------------------------------------------------------------- void __fastcall TForm1::EditTippGChange(TObject *Sender) { TippG = StrToFloat ( EditTippG->Text ); } //--------------------------------------------------------------------------- void __fastcall TForm1::ButtonTippClick(TObject *Sender) { if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Energie Cottbus - FC Schalke 04" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Energie Cottbus - FC Schalke 04 "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Werder Bremen - F.C. Hansa Rostock" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Werder Bremen - F.C. Hansa Rostock "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Bayern München - Eintracht Frankfurt" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Bayern München - Eintracht Frankfurt "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Bayer 04 Leverkusen - DSC Arminia Bielefeld" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Bayer 04 Leverkusen - DSC Arminia Bielefeld "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="1.FC Nürnberg - VfB Stuttgart" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" 1.FC Nürnberg - VfB Stuttgart "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Hamburg SV - Herta BSC Berlin" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Hamburg SV - Herta BSC Berlin "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Hannover 96 - Borussia Dortmund" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Hannover 96 - Borussia Dortmund "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="VfL Bochum - VfL Wolfsburg" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" VfL Bochum - VfL Wolfsburg "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="Karlsruher SC - MSV Duisburg" ) { StringGrid->Cells[1][i] =" "+(VName)+", "+AnsiString (NName); StringGrid->Cells[2][i] =" Karlsruher SC - MSV Duisburg "; StringGrid->Cells[3][i] =" "+FloatToStr(TippH)+" : "+FloatToStr(TippG); i=i+1; } if ( ComboPaarung->Items->Strings[ComboPaarung->ItemIndex]=="" ) { Application->MessageBox("Achtung!\nKeine Paarung gewählt!","Fehlermeldung:",16+32); } } //--------------------------------------------------------------------------- void __fastcall TForm1::EditNNameChange(TObject *Sender) { NName = ( EditNName->Text ); } //---------------------------------------------------------------------------
Und hier schliesslich noch das Programm in einem WinRaR Archiv zum Donwloaden:
http://www.1-filehost.midnightirc.in...fzxGj2rKdxujC0
Freuen mich über jede Hilfe! Bitte heute abend noch
Gruß scummyGeändert von scummy (07.11.07 um 17:48 Uhr)
-
vllt. bin ich ein bissl spät dran , sry ! Mit den Messageboxen hab ich mich jetzt nocht nicht beschäftigt ich hätte das prob wahrscheinlich mit einer neuen WindowsForm gelöst, welche 2 buttons enthält ja und nein . Meine variante !
MfG rueD...
-
Hy,
besser zu spät, als nie:
Code :1 2 3 4 5 6 7 8
if(Application->MessageBox("Message Text","Titel",MB_YESNO) == IDYES) { //wenn ja gedrückt } else { //wenn nein gedrückt }
Das sollte so ungefähr dass sein, was du brauchst...
mfgnoch 'n bischen Werbung in eigener Sache: www.ice-only.de
-
Hallo,
hier noch ein Beitrag zum Auswerten der MessageBox Buttons . . .
int button;
button = MessageBox(0,"MessageText","Titel",MB_YESNO);
if(button == IDYES)
{
//tue dies (Ja wurde angeklickt)
}
else
{
// tue das (Nein wurde angeklickt)
}
funktioniert auch mit MB_OK, MB_YESNOCANCEL etc .
Ähnliche Themen
-
Messagebox
Von Rene42 im Forum .NET Windows FormsAntworten: 1Letzter Beitrag: 30.01.09, 15:18 -
MessageBox
Von shader09 im Forum C/C++Antworten: 2Letzter Beitrag: 18.10.07, 13:27 -
MessageBox
Von Winner im Forum VisualStudio & MFCAntworten: 5Letzter Beitrag: 15.10.07, 15:21 -
Access 2000 Ja/Nein Button auf Nein setzen
Von RavelinePower im Forum Office-AnwendungenAntworten: 5Letzter Beitrag: 24.12.04, 00:32 -
MessageBox
Von W-Stefan im Forum HTML & XHTMLAntworten: 4Letzter Beitrag: 10.09.04, 12:41





Zitieren
Login






