Home > Back-end >  Meet a strange, for help, TDBEDIT. READONLY doesn't work
Meet a strange, for help, TDBEDIT. READONLY doesn't work

Time:10-03

I have a piece of code below, that is, to control the READONLY TDBEDIT controls, very simple,
However, in the process of running, the DOCTYPE_CODE type change, such as by STD switch to XX,
Hope TDBEDIT, be able to write, but still read only, can't write, tracking, clearly performed dbedit2. : ReadOnly=false; Statement
It is doesn't work, it is strange that never met this kind of thing, for help.

With zq_wkpiece do
The begin
If the state [dsinsert, dsedit] then in
The begin
If the trim (fieldbyname (' doctype_code). AsString) are identical='STD' then
The begin
Dbedit2. Color:=clbtnshadow;
Dbedit4. Color:=clbtnshadow;

Dbedit2. ReadOnly:=true;
Dbedit4. ReadOnly:=true;
End the else
The begin
Dbedit2. Color:=clwindow;
Dbedit4. Color:=clwindow;

dbedit2. ReadOnly:=false;
Dbedit4. ReadOnly:=false;

end;
end;//if the state in... Then
end;//with zq_wkpiece do

CodePudding user response:

The primary key can't be edit has nothing to do with READoNLY

CodePudding user response:

1) primary key also can edit,
2) these two fields, in my program, is not the primary key field,

I was collapsed, don't know where is the problem?

CodePudding user response:

The dataset fields in ReadOnly will affect state of ReadOnly data-aware controls

CodePudding user response:

READONLY dataset related field is set to FALSE, interface on other fields can also edit,

Is that the two fields, because it is TRUE, after switching to FALSE, or not, but the other fields can edit (other fields without switching of TRUE and FALSE).

CodePudding user response:

I mean setting field attribute readonly directly, if be sure to set the properties of the controls, can be in action list. The real-time control interface state onupdate event
  • Related