如果combobx中有一项为ok,则出现form1,如不是则出现form2.
应该怎么实现?
应该怎么实现?
解决方案 »
- delphi 做手机 要哪些 插件
- 从一个panel切到另外一个panel后,记住原来panel上得到焦点的组件
- 請教關於內存釋放的問題。(動態建立的控件保存在Tlist中)
- 数据库开发交流群号:1435478
- 想换程序学习的网友请进。
- 为什么我的机器无法运行带数据库的程序了?
- 紧急!我原本有一个主窗体但设置一个登陆验证窗体后,登陆主窗体不能激活子窗体,为什么?
- 如何寻找鼠标的坐标?很急!很急!很急!很急!很急!
- 如何打印
- 如何用QuickRep打印出以下格式?
- 每次Delphi6死以后,我的IDE窗口设置总是恢复到原来窗口,怎么让IDE窗口保持不变呢
- 绝对高分征求关于BDE的问题!(今晚在线等待..)
是不是选择OK就显示form1?
begin
if ComboBox1.Items.Strings[i] = 'ok' then
begin
form1.show;
end
else begin
form2.show;
end;
end
if ComboBox1.Text = 'ok' then
begin
form1.show;
end;
form1.showmodal
else
from2.showmodal;
begin
if Uppercase(Trim(ComboBox1.Text)) = 'OK' then
begin
if Form2 = nil then
Form2 := TForm2.Create(self);
Form2.ShowModal
end else
begin
if Form3 = nil then
Form3 := TForm3.Create(self);
Form3.ShowModal
end;
end;
保存from1.combobox1.Items.LoadFromFile(filename);
登陆
应该怎么实现?
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2, Unit3;{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to 10 do
begin
combobox1.items.add(inttostr(i));
end;
combobox1.items.add('ok');
for i:=0 to 10 do
begin
combobox1.items.add(inttostr(i));
end;end;procedure TForm1.Button2Click(Sender: TObject);
begin
if combobox1.Items.IndexOf('ok')=-1 then form2.show
else form3.show;
end;end.
谢谢
有没有不需用到savetofile的方法?
是在程序中动态的添加的,程序关闭,当然就没了。要永久的保存,方法就是将动态添加的信息也保存起来~如savetofile或是保存到数据库的某个字段里,然后在程序启动时再动态的添加进去.