Q&A

  • 타이틀바없는 폼(bsnone) 을 어떻게 하면 움직여지나여??
폼의 구성형식은 다음과 같읍니다.

폼위에 TImage써서 gif이미지를 바탕으로 하고요 ... 하단부에는 Listbox컴포넌트를 붙이고, 버튼 및 ...라벨... 등으로 구성을 하고 폼스타일은 Bsnone으로 하고요 ... 그런데 폼을 마우스로 움직이고 싶은데.. 다음코드를 넣었는데 안먹더라구요...

private

procedure WMNCHitTest(var M: TWMNCHitTest); message WM_NCHitTest;

procedure TForm1.WMNCHitTest(var M:TWMNCHitTest);

begin

inherited;

if M.Result = htClient then

M.Result := htCaption;

end;



잘 모르겠읍니다.. 이부분을 빨리 해결해야 하는데...

전체 코드를 아래에 삽입합니다...



unit ChargeU;



interface



uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls, Mask, Yislabel, ExtCtrls, jpeg, Buttons, TracePixel, UjetButton;



type

TUCharge = class(TForm)

Image1: TImage;

UCnum1: TMaskEdit;

UCnum2: TMaskEdit;

UCnum3: TMaskEdit;

UCnum4: TMaskEdit;

CMoney: TEdit;

UChargeReq: TJetButton;

UCancelReq: TJetButton;

BMBalance: TLabel;

AMBalance: TLabel;

BUBalance: TLabel;

AUBalance: TLabel;

MMode: TJetButton;

MChange: TJetButton;

JetButton1: TJetButton;

ListBox1: TListBox;

//procedure FormCreate(Sender: TObject);

//procedure CreateParams(var Params: TCreateParams); override;

//procedure FormPaint(Sender: TObject);

procedure UChargeReqClick(Sender: TObject);

procedure UCancelReqClick(Sender: TObject);

procedure EnterTimerTimer(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

procedure MmodeClick(Sender: TObject);

procedure MchangeClick(Sender: TObject);

procedure FormShow(Sender: TObject);

procedure MListClick(Sender: TObject);

procedure JetButton1Click(Sender: TObject);

procedure WMNCHitTest(var M: TWMNCHitTest);



private

{ Private declarations }



public

{ Public declarations }

end;



var

UCharge: TUCharge;



implementation



uses uMain, Weblib, LogIn, ChargeImage, ChargeShow;



{$R *.DFM}



procedure TUCharge.FormShow(Sender: TObject);

begin

{EnterTimer.enabled := true;

AMainForm.Hide;

}

end;





procedure TUCharge.UChargeReqClick(Sender: TObject);

var

NowTime,ChargeTime,ListText :String;



begin

BUBalance.Caption := '15,000원';

AUBalance.Caption := '20,000원';

BMBalance.Caption := '100,000원';

AMBalance.Caption := '105,000원';



NowTime := DateTimeToStr(NOW);

ChargeTime := copy(NowTime,1,8);

ListText := format('%10s %s %3s %s %2s %s %1s %s %s %3s %s %s',['',ChargeTime,'',Entrance.LogInId.Text,'',

UCnum1.Text+'-'+UCnum2.Text+'-'+UCnum3.Text+'-'+UCnum4.Text,'',

CMoney.Text,'원','',AMBalance.Caption,'원']);

UCharge.Listbox1.items.Add(ListText);

CSReqShow.show;

end;



procedure TUCharge.UCancelReqClick(Sender: TObject);

var

i : integer;

begin

for i := 0 to ComponentCount - 1 do

begin

if ( Components[i] is TEdit ) then

begin



( Components[i] as TEdit ).Clear;

end;

end;



for i := 0 to ComponentCount - 1 do

begin

if ( Components[i] is TMaskEdit ) then

begin



( Components[i] as TMaskEdit ).Clear;

end;

end;

end;



procedure TUCharge.EnterTimerTimer(Sender: TObject);

begin



end;



procedure TUCharge.BitBtn1Click(Sender: TObject);

begin

{if BitBtn1.Tag =0 then

begin

UCharge.Height := 440;

BitBtn1.Tag := 1;

end

else

begin

UCharge.Height := 317 ;

BitBtn1.Tag := 0;

end; }

end;



procedure TUCharge.MmodeClick(Sender: TObject);

begin

AMainForm.Visible := true;

AMainform.Notebook1.PageIndex := 0;

AMainForm.show;

end;



procedure TUCharge.MchangeClick(Sender: TObject);

begin

Entrance.show;

end;







procedure TUCharge.MListClick(Sender: TObject);

begin

begin

{if MList.Tag =0 then

begin

UCharge.Height := 440;

MList.Tag := 1;

end

else

begin

UCharge.Height := 317 ;

MList.Tag := 0;

end; }

end;

end;



procedure TUCharge.WMNCHitTest(var M: TWMNCHitTest);

begin

inherited;

if (M.YPos > top + MMode.Top) and (M.YPos < top + MMode.Top + MMode.Height)

and (M.XPos > Left + MMode.Left) and (M.XPos < Left + MMode.Left + MMode.Width) then exit;

if (M.YPos > top + MChange.Top) and (M.YPos < top + MChange.Top + MChange.Height)

and (M.XPos > Left + MChange.Left) and (M.XPos < Left + MChange.Left + MChange.Width) then exit;

if (M.YPos > top + UChargeReq.Top) and (M.YPos < top + UChargeReq.Top + UChargeReq.Height)

and (M.XPos > Left + UChargeReq.Left) and (M.XPos < Left + UChargeReq.Left + UChargeReq.Width) then exit;

if (M.YPos > top + UCancelReq.Top) and (M.YPos < top + UCancelReq.Top + UCancelReq.Height)

and (M.XPos > Left + UCancelReq.Left) and (M.XPos < Left + UCancelReq.Left + UCancelReq.Width) then exit;

if (M.YPos > top + JetButton1.Top) and (M.YPos < top + JetButton1.Top + JetButton1.Height)

and (M.XPos > Left + JetButton1.Left) and (M.XPos < Left + JetButton1.Left + JetButton1.Width) then exit;

if M.Result = htClient then

M.Result := htCaption;



end;



procedure TUCharge.JetButton1Click(Sender: TObject);

begin

Entrance.close;

end;



end.



0  COMMENTS