Z
zrj
Unregistered / Unconfirmed
GUEST, unregistred user!
1.我想richedit得第一行,红色显示'dffd',第2行,绿色显示'dsfs',用下面代码如何实现?(请大家修改)
with richedit1 do
begin
Alignment:=tacenter;
font.Size:=18;
lines.Clear;
font.style:=font.style+[fsitalic];
font.Color:=clgray;
lines.Add(title.text);
font.Size:=10;
alignment:=taleftjustify;
lines.add('sdfs');
end
2.procedure Tpaper.closeClick(Sender: TObject);
begin
if dm.papertable.State in dsEditmodes then
if application.messagebox('数据已经修改,是否要保存?','退出警告',MB_OKCANCEL +mbicon_confirm+ MB_DEFBUTTON1) <> IDOK then
else
dm.paperTable.Post;
close;
end;
这样判断这个table(passtable)得state不能成功啊,该如何判断???
3.我想动态创建登陆窗体,如果登陆成功再创建其它窗体,该如何作??var passform:tform;
begin
Application.Initialize;
Application.CreateForm(Tdm, dm);(数据窗体,要判断密码,因此先创建)
passform:=tpassform.create(application);
passform.show;
passform.Update;
if passform.passbtn.ModalResult=mrok then
begin
Application.CreateForm(Tmainform, mainform);
Application.CreateForm(Tinputq, inputq);
Application.CreateForm(Tselectquestion, selectquestion);
Application.CreateForm(Tautoselectform, autoselectform);
Application.CreateForm(Tbackup, backup);
Application.CreateForm(Tuserform, userform);
passform.Hide;
passform.Free;
Application.Run;
end
else
begin
passform.Hide;
passform.Free;
Application.Terminate;
end
我想要passform得passbtn(一个button名字)单及判断是否密码正确,要是正确,设置
ModalResult直为idok,然后再创建其它窗体,这样作对嘛??该如何作??
with richedit1 do
begin
Alignment:=tacenter;
font.Size:=18;
lines.Clear;
font.style:=font.style+[fsitalic];
font.Color:=clgray;
lines.Add(title.text);
font.Size:=10;
alignment:=taleftjustify;
lines.add('sdfs');
end
2.procedure Tpaper.closeClick(Sender: TObject);
begin
if dm.papertable.State in dsEditmodes then
if application.messagebox('数据已经修改,是否要保存?','退出警告',MB_OKCANCEL +mbicon_confirm+ MB_DEFBUTTON1) <> IDOK then
else
dm.paperTable.Post;
close;
end;
这样判断这个table(passtable)得state不能成功啊,该如何判断???
3.我想动态创建登陆窗体,如果登陆成功再创建其它窗体,该如何作??var passform:tform;
begin
Application.Initialize;
Application.CreateForm(Tdm, dm);(数据窗体,要判断密码,因此先创建)
passform:=tpassform.create(application);
passform.show;
passform.Update;
if passform.passbtn.ModalResult=mrok then
begin
Application.CreateForm(Tmainform, mainform);
Application.CreateForm(Tinputq, inputq);
Application.CreateForm(Tselectquestion, selectquestion);
Application.CreateForm(Tautoselectform, autoselectform);
Application.CreateForm(Tbackup, backup);
Application.CreateForm(Tuserform, userform);
passform.Hide;
passform.Free;
Application.Run;
end
else
begin
passform.Hide;
passform.Free;
Application.Terminate;
end
我想要passform得passbtn(一个button名字)单及判断是否密码正确,要是正确,设置
ModalResult直为idok,然后再创建其它窗体,这样作对嘛??该如何作??