Licznik kliknięć w Builder 6
Ostatnio zmodyfikowano 2016-09-11 00:34
latajacaryba Temat założony przez niniejszego użytkownika |
» 2016-09-11 00:34:58 Już skończyłem. Jeśli ktoś powie mi jak to wstawie program, by osoby nieużytkujące buildera mogły skorzystać Na marginesie, tak wygląda kod
#include <vcl.h> #pragma hdrstop
#include "Unitpraca.h"
#pragma package(smart_init) #pragma resource "*.dfm" TForm1 * Form1; int x = 0;
__fastcall TForm1::TForm1( TComponent * Owner ) : TForm( Owner ) { }
void __fastcall TForm1::Button1Click( TObject * Sender ) { int y = 0; x = x + 1; Button1->Caption = x; Button2->Visible = false; if( Label1->Font->Color == clRed && y == 0 ) { Label1->Font->Color = clYellow; y = 1; } if( Label1->Font->Color == clYellow && y == 0 ) { Label1->Font->Color = clBlue; y = 1; } if( Label1->Font->Color == clBlue && y == 0 ) { Label1->Font->Color = clBlack; y = 1; } if( Label1->Font->Color == clBlack && y == 0 ) { Label1->Font->Color = clGreen; y = 1; } if( Label1->Font->Color == clGreen && y == 0 ) { Label1->Font->Color = clRed; y = 1; } if( x % 50 == 0 ) { Button2->Visible = true; } }
void __fastcall TForm1::Label1Click( TObject * Sender ) { ; }
void __fastcall TForm1::wczytajgre1Click( TObject * Sender ) { if( OpenDialog1->Execute() ) { ; } }
void __fastcall TForm1::FormCreate( TObject * Sender ) { ; }
void __fastcall TForm1::Zapiszwynik1Click( TObject * Sender ) { ; }
void __fastcall TForm1::Button2Click( TObject * Sender ) { x = x + 10; Button2->Visible = false; Button1->Caption = x; }
|
|
1 « 2 » |