Home > Back-end >  Onchange how to distinguish the assignment in front desk operations or programs operate?
Onchange how to distinguish the assignment in front desk operations or programs operate?

Time:09-22

Delphi edit only one onchange events, there is no specific to distinguish interactivechange from programmaticchange, how to distinguish operation to modify the program in use assignment changes, try the modified properties, the dephi tedit control, if no problem, but with a third party accused of ehlib tdbnumerediteh, with TMS tadvedit can't distinguish between, what method to distinguish the two types of events?

CodePudding user response:

This there is no distinction between

If it is the manual assignment, generally have to set up a state variables

CodePudding user response:

Must distinguish, in a TEdit. Onchange event, to find if there is a keyboard entry, via keyboard entry, I think can distinguish,

CodePudding user response:

In general, for the sake of consistency, no matter who caused the value changes, should be treated accordingly,

But if the original poster must distinguish, had to add a mark fields, application Settings before, buy a bit, check the sign in the onchange event, set out to cancel the sign bit,



CodePudding user response:

refer to the second floor lyhoo163 response:
I must distinguish, in TEdit. Onchange event, to find if there is a keyboard entry, via keyboard entry, I think can distinguish,


It's not, right click paste, isn't it, ah


Support 3 floor

CodePudding user response:

reference findcsdn reply: 3/f
general situation, in order to program the consistency, regardless of who caused the value change, should be treated accordingly,

But if the original poster must distinguish, had to add a mark fields, application Settings before, buy a bit, check the sign in the onchange event, set out to cancel the sign bit,

Top, set a variable in the onChange judgment!

CodePudding user response:

If
 var flag: Integer; 
Procedure TForm1. Edt1KeyPress (Sender: TObject; Var Key: Char);
The begin
Flag:=1;
end;

Procedure TForm1. Btn1Click (Sender: TObject);
The begin
If (not edt1. Text=' ') and flag=1 then
The begin
ShowMessage (' artificially assignment);
end;
end;


This should mean, marked flag variables

CodePudding user response:

refer to 6th floor uhjiok123 response:
if
 var flag: Integer; 
Procedure TForm1. Edt1KeyPress (Sender: TObject; Var Key: Char);
The begin
Flag:=1;
end;

Procedure TForm1. Btn1Click (Sender: TObject);
The begin
If (not edt1. Text=' ') and flag=1 then
The begin
ShowMessage (' artificially assignment);
end;
end;


This should mean, flag variable marked


No compiler, which means in the edit content, and in the press the keyboard, in the edit (content as the character, can't be a backspace) is user of human action
  • Related