1. Form이 3개가 있읍니다 . 로그인폼, Form1, Form2 .. 처리순서는 로그인폼 --> Form1 --> Form2 그런데 여기서 Form2는 hidden을 시키고 싶거든요 .... 즉 로그인을 하면 Form1이 나오는데 Form2를 실행시킬수 있는 권한이 인증을 거쳐서 진행이 되거든여.. 무슨방법이 있는지 ??
2. 리스트보기버튼을 누르면 StringGrid가 나오고 닫기버튼을 누르면 StringGrid가 없어지는 것을 하는겁니다. 폼 처음 띄워질때는 StringGrid가 없어지게 보이는 상태로요...
그래서 생각한게 폼이 띄워질때 StringGrid의 높이를 0으로 하고 폼높이도 StringGrid높이만큼 빼주고요...그리고 버튼을 누르면 폼과 StringGrid높이를 일정크기만큼 정해서 나와서 보이게끔 하는거지요... 그런데 .pas파일에서는 잘 안되더라구요... 그래서 .dpr파일에서 고쳐야하는지 .... 그래서 소스를 밑에 보이도록 하겠읍니다...
[.dpr]
program pMain;
uses
Forms,
uMain in 'uMain.pas' {AMainForm},
Weblib in 'Weblib.pas' {WebForm},
calendar in 'calendar.pas' {CalendarForm},
LogIn in 'LogIn.pas' {Entrance},
Regmaster in 'Regmaster.pas' {MasterReg},
LostID in 'LostID.pas' {LI},
LostPasswd in 'LostPasswd.pas' {LP},
Res_LostID in 'Res_LostID.pas' {ResLI},
Res_LostPasswd in 'Res_LostPasswd.pas' {ResLP},
ResRegMaster in 'ResRegMaster.pas' {ResNewMaster},
MsgBox in 'MsgBox.pas' {MsgDlg},
SelCard in 'SelCard.pas' {ASelectCardForm},
AlbaReg in 'AlbaReg.pas' {ARF},
AlbaCut in 'AlbaCut.pas' {ACF},
AlbaInfo in 'AlbaInfo.pas' {AIF},
AlbaModify in 'AlbaModify.pas' {AMF},
ResAlbaInfo in 'ResAlbaInfo.pas' {ResAI},
MasterModify in 'MasterModify.pas' {MModify},
MPasswd in 'MPasswd.pas' {MPWModify},
CSPrint in 'CSPrint.pas' {uPrint},
ChargeUser in 'ChargeUser.pas' {UserCharge};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TUserCharge, UserCharge);
Application.CreateForm(TAMainForm, AMainForm);
Application.CreateForm(TCalendarForm, CalendarForm);
Application.CreateForm(TWebForm, WebForm);
Application.CreateForm(TEntrance, Entrance);
Application.CreateForm(TMasterReg, MasterReg);
Application.CreateForm(TLI, LI);
Application.CreateForm(TLP, LP);
Application.CreateForm(TResLI, ResLI);
Application.CreateForm(TResLP, ResLP);
Application.CreateForm(TResNewMaster, ResNewMaster);
Application.CreateForm(TMsgDlg, MsgDlg);
Application.CreateForm(TASelectCardForm, ASelectCardForm);
Application.CreateForm(TARF, ARF);
Application.CreateForm(TACF, ACF);
Application.CreateForm(TAIF, AIF);
Application.CreateForm(TAMF, AMF);
Application.CreateForm(TResAI, ResAI);
Application.CreateForm(TMModify, MModify);
Application.CreateForm(TMPWModify, MPWModify);
Application.CreateForm(TuPrint, uPrint);
Application.Run;
end.
[.pas파일]
unit ChargeUser;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, Yislabel, ExtCtrls, Grids, Buttons, ComCtrls, ToolWin;
type
TUserCharge = class(TForm)
ChargeList: TStringGrid;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
YISLabel49: TYISLabel;
YISLabel50: TYISLabel;
YISLabel72: TYISLabel;
UCCardnum1: TMaskEdit;
UCCardnum2: TMaskEdit;
UCCardnum3: TMaskEdit;
UCCardnum4: TMaskEdit;
UCValue: TMaskEdit;
UCReq: TButton;
Button1: TButton;
YISLabel1: TYISLabel;
YISLabel2: TYISLabel;
YISLabel3: TYISLabel;
YISLabel4: TYISLabel;
YISLabel5: TYISLabel;
YISLabel6: TYISLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
SpeedButton1: TSpeedButton;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
LITimer: TTimer;
procedure FormShow(Sender: TObject);
procedure UCReqClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure LITimerTimer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure Res_Process(sel : boolean);
end;
var
UserCharge: TUserCharge;
implementation
uses Weblib, LogIn, uMain;
{$R *.DFM}
procedure TUSerCharge.FormShow(Sender: TObject); // 폼이 보여질때....
begin
LITimer.enabled := true;
UserCharge.height := 350 ;
chargeList.Height :=0;
end;
procedure TUserCharge.UCReqClick(Sender: TObject);
var i:Integer;
begin
Webform.REQ_CHARGE_CARD(Entrance.LogInGubun.itemindex,Entrance.LogInId.Text,UCCardnum1.Text+UCCardnum2.Text+UCCardnum3.Text+UCCardnum4.Text,
UCValue.Text,'9999');
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 TUserCharge.Button1Click(Sender: TObject);
begin
close;
end;
procedure TUserCharge.SpeedButton1Click(Sender: TObject); // 리스트보기버튼을 누를때
var i:Integer; Beforedate,AfterDate: String;
begin
UserCharge.Height := 500;
ChargeList.Height := 150;
BeforeDate := DateTimeToStr(Now-1);
AfterDate := DateTimeToStr(Now+1);
//BeforeDate := FormatDateTime('yyyy-mm-dd', TDateTime);
//AfterDate := FormatDateTime('yyyy-mm-dd', TDateTime);
WebForm.REQ_CHARGE_SALELIST(Entrance.LogInId.Text,Beforedate,
AfterDate,'0');
for i := 0 to ComponentCount - 1 do
begin
if ( Components[i] is TEdit ) then
begin
( Components[i] as TEdit ).Clear;
end;
end;
end;
procedure TUserCharge.Res_Process(sel: boolean) ;
var
n,count :Integer;
begin
if WebForm.GetErrCode() = 0 then
begin
if Webform.GetMethod = 'RES_CHARGE_CARD' then
begin
Label1.Caption := WebForm.GetParam('AMOUNT');
Label2.Caption := WebForm.GetParam('USER_PREBALANCE');
Label3.Caption := WebForm.GetParam('USER_BALANCE');
Label4.Caption := WebForm.GetParam('PCBANG_PREBALANCE');
Label5.Caption := WebForm.GetParam('PCBANG_BALANCE');
end;
if WebForm.GetMethod= 'RES_CHARGE_SALELIST' then
begin
count := StrToInt(WebForm.GetParam('LIST_COUNT'));
ChargeList.RowCount := count;
for n :=1 to count do
begin
ChargeList.Cells[0,n-1] := IntToStr(n);
ChargeList.Cells[1,n-1] := WebForm.GetListParam('LIST_DATETIME',N);
ChargeList.Cells[2,n-1] := WebForm.GetListParam('LIST_ALBAID',n);
ChargeList.Cells[3,n-1] := WebForm.GetListParam('LIST_MSG',n);
ChargeList.Cells[4,n-1] := WebForm.GetListParam('LIST_AMOUNT',n);
ChargeList.Cells[5,n-1] := WebForm.GetListParam('LIST_BALANCE',n);
end;
end;
end;
end;
procedure TUserCharge.ToolButton1Click(Sender: TObject);
begin
AMainForm.show;
end;
procedure TUserCharge.ToolButton2Click(Sender: TObject);
begin
Entrance.show;
end;
procedure TUserCharge.LITimerTimer(Sender: TObject);
begin
if not LITimer.enabled then exit;
LITimer.enabled := false ;
if Entrance.showmodal <> mrok then
close();
end;
end.
stringgrid.visible 을 이용하십시오.
1.보여랏!
stringgrid.visible:=true
2.숨겨랏!
stringgrid.visible:=false
바라미~
> 2. 리스트보기버튼을 누르면 StringGrid가 나오고 닫기버튼을 누르면 StringGrid가 없어지는 것을 하는겁니다. 폼 처음 띄워질때는 StringGrid가 없어지게 보이는 상태로요...
> 그래서 생각한게 폼이 띄워질때 StringGrid의 높이를 0으로 하고 폼높이도 StringGrid높이만큼 빼주고요...그리고 버튼을 누르면 폼과 StringGrid높이를 일정크기만큼 정해서 나와서 보이게끔 하는거지요... 그런데 .pas파일에서는 잘 안되더라구요... 그래서 .dpr파일에서 고쳐야하는지 .... 그래서 소스를 밑에 보이도록 하겠읍니다...