spinedit에서 enter를 누르면 다른 spnedit로 포커스를 주려고 하는데 spinedit에서는 keypress event가 발생하지 않네요..edit component에서 keypress event를 발생시켜서 enter로 다음 항목 이동을 하지 않습니까?그것 처럼 spinedit를 이용하고 싶거든요...
function TSpinEdit.IsValidChar(Key: Char): Boolean;
begin
Result := (Key in [DecimalSeparator, '+', '-', '0'..'9']) or
((Key < #32) and (Key <> Chr(VK_RETURN)));
if not FEditorEnabled and Result and ((Key >= #32) or
(Key = Char(VK_BACK)) or (Key = Char(VK_DELETE))) then
Result := False;
end;
영인 께서 말씀하시기를...
> 안녕하셔요...
> 질문이 하나 생겨서요...
> spinedit에서 enter를 누르면 다른 spnedit로 포커스를 주려고 하는데 spinedit에서는 keypress event가 발생하지 않네요..edit component에서 keypress event를 발생시켜서 enter로 다음 항목 이동을 하지 않습니까?그것 처럼 spinedit를 이용하고 싶거든요...
안녕하셔요... 질문이 하나 생겨서요... spinedit에서 enter를 누르면 다른 spnedit로 포커스를 주려고 하는데 spinedit에서는 keypress event가 발생하지 않네요..edit component에서 keypress event를 발생시켜서 enter로 다음 항목 이...
입력값을 걸러서 이벤트를 발생시키는 군요...
소스를 고치면 되겠지만 뭔가 이유가 있어서 그렇게 했겠지요
가능하면 keydown이벤트를 이용하세요..
procedure TSpinEdit.KeyPress(var Key: Char);
begin
if not IsValidChar(Key) then
begin
Key := #0;
MessageBeep(0)
end;
if Key <> #0 then inherited KeyPress(Key);
end;
function TSpinEdit.IsValidChar(Key: Char): Boolean;
begin
Result := (Key in [DecimalSeparator, '+', '-', '0'..'9']) or
((Key < #32) and (Key <> Chr(VK_RETURN)));
if not FEditorEnabled and Result and ((Key >= #32) or
(Key = Char(VK_BACK)) or (Key = Char(VK_DELETE))) then
Result := False;
end;
영인 께서 말씀하시기를...
> 안녕하셔요...
> 질문이 하나 생겨서요...
> spinedit에서 enter를 누르면 다른 spnedit로 포커스를 주려고 하는데 spinedit에서는 keypress event가 발생하지 않네요..edit component에서 keypress event를 발생시켜서 enter로 다음 항목 이동을 하지 않습니까?그것 처럼 spinedit를 이용하고 싶거든요...
>
> 방법을 좀 알려주시면 대단히 감사하겠습니다.....