"Unit1.cpp" Dosyası
#include <vcl\vcl.h>
#pragma hdrstop
#include "Unit1.h"
#pragma resource "*.dfm"
TForm1 *Form1;
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner):TForm(Owner)
{
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
DWORD Sitil;
//Buton'un başlık yazısı solda
Sitil = GetWindowLong(Button1->Handle, GWL_STYLE);
Sitil = Sitil | BS_LEFT;
SetWindowLong(Button1->Handle, GWL_STYLE, Sitil);
Button1->Invalidate();
}
//---------------------------------------------------------------------------
//-------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
DWORD Sitil;
Button2->Caption = Button2->Caption.Trim();
//Buton'un başlık yazısı ortada.
Sitil = GetWindowLong(Button2->Handle, GWL_STYLE);
Sitil = Sitil | BS_CENTER;
SetWindowLong(Button2->Handle, GWL_STYLE, Sitil);
Button2->Invalidate();
}
//---------------------------------------------------------------------------
//-------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
DWORD Sitil;
//Buton'un başlık yazısı sağda.
Sitil = GetWindowLong(Button3->Handle, GWL_STYLE);
Sitil = Sitil | BS_RIGHT;
SetWindowLong(Button3->Handle, GWL_STYLE, Sitil);
Button3->Invalidate();
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
"Unit1.h" Dosyası
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TButton *Button2;
TButton *Button3;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
PROGRAMIN EKRAN GÖRÜNTÜSÜ
<<< Geri Dön