我前几天问过一个问题
××××
界面上有一个员工列表
用户选择一名员工,则他的详细信息出现在各个对应的
edit,combobox,或checkbox上。
这是Save Button是disabled
当用户一改动任何一项
save button 就应该enabled
这个如何实现
×××
有位大侠指点我说用standard action的dataset中的Tdatasetpost
这个action中有一个property: datasource
当界面上信息只对应一张表的时候,很容易就可以设置这个属性来解决问题
但当一个form上的信息可能对应多张表时。应该如何处理呢,有经验的朋友能不能介绍一下。
谢谢
××××
界面上有一个员工列表
用户选择一名员工,则他的详细信息出现在各个对应的
edit,combobox,或checkbox上。
这是Save Button是disabled
当用户一改动任何一项
save button 就应该enabled
这个如何实现
×××
有位大侠指点我说用standard action的dataset中的Tdatasetpost
这个action中有一个property: datasource
当界面上信息只对应一张表的时候,很容易就可以设置这个属性来解决问题
但当一个form上的信息可能对应多张表时。应该如何处理呢,有经验的朋友能不能介绍一下。
谢谢
if Button1.Enabled = false then Button1.Enabled = true;在每个控件的OnChange事件中 调用此函数
procedure TMainForm.DataSource1StateChange(Sender: TObject);
begin
with (Sender as TDataSource).DataSet do
if ((State=dsEdit) or (State=dsInsert)) then
ButtonSave.Enabled:=True
else
ButtonSave.Enabled:=False;
end;