| 12
 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
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 
 |  
 
// la form en format Texte
object Form117: TForm117
  Left = 0
  Top = 0
  Caption = 'Form117'
  ClientHeight = 261
  ClientWidth = 185
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Edit1: TEdit
    Left = 35
    Top = 25
    Width = 121
    Height = 21
    TabOrder = 0
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit2: TEdit
    Left = 35
    Top = 52
    Width = 121
    Height = 21
    TabOrder = 1
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit3: TEdit
    Left = 35
    Top = 81
    Width = 121
    Height = 21
    TabOrder = 2
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit4: TEdit
    Left = 35
    Top = 109
    Width = 121
    Height = 21
    TabOrder = 3
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit5: TEdit
    Left = 35
    Top = 138
    Width = 121
    Height = 21
    TabOrder = 4
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit6: TEdit
    Left = 35
    Top = 166
    Width = 121
    Height = 21
    TabOrder = 5
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit7: TEdit
    Left = 35
    Top = 195
    Width = 121
    Height = 21
    TabOrder = 6
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
  object Edit8: TEdit
    Left = 35
    Top = 222
    Width = 121
    Height = 21
    TabOrder = 7
    OnEnter = EditEnter
    OnExit = EditExit
    OnKeyPress = LabelKeyPress
  end
end
 
// le hpp
//---------------------------------------------------------------------------
 
#ifndef Unit117H
#define Unit117H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
//---------------------------------------------------------------------------
class TForm117 : public TForm
{
__published:	// Composants gérés par l'EDI
	TEdit *Edit1;
	TEdit *Edit2;
	TEdit *Edit3;
	TEdit *Edit4;
	TEdit *Edit5;
	TEdit *Edit6;
	TEdit *Edit7;
	TEdit *Edit8;
    void __fastcall LabelKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall EditEnter(TObject *Sender);
	void __fastcall EditExit(TObject *Sender);
 
private:	// Déclarations utilisateur
public:		// Déclarations utilisateur
	__fastcall TForm117(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm117 *Form117;
//---------------------------------------------------------------------------
#endif
 
 
// le cpp
// ---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "Unit117.h"
// ---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm117 *Form117;
 
// ---------------------------------------------------------------------------
__fastcall TForm117::TForm117(TComponent* Owner)
	: TForm(Owner)
{
 
}
 
// ---------------------------------------------------------------------------
void __fastcall TForm117::LabelKeyPress(TObject *Sender, System::WideChar &Key)
{
	if (Key == 0x0D)
	{
		SelectNext(dynamic_cast<TWinControl*>(Sender), true, true);
		Key = 0;
	}
}
 
// ---------------------------------------------------------------------------
void __fastcall TForm117::EditEnter(TObject *Sender)
{
	dynamic_cast<TEdit*>(Sender)->Color = (TColor)10483700;
}
 
// ---------------------------------------------------------------------------
void __fastcall TForm117::EditExit(TObject *Sender)
{
	dynamic_cast<TEdit*>(Sender)->Color = clWindow;
}
// --------------------------------------------------------------------------- | 
Partager