Is it possible that a TEdit control changes its size during the user is editing in this TEdit Field (like as MS Word).
How can I solve this?
Best wishes
Bernhard
TEdit and resizing
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
You can assign this code to OnChange of TEdits:
(do not forget to reassign it in OnControlAction, after RVF loading).
There is one problem: AdjustControlPlacement2 does not update item resizer. It will be fixed in the next update.
Code: Select all
procedure TForm1.OnControlChange(Sender: TObject);
var txt: TEdit;
begin
txt := (Sender as TEdit);
Canvas.Font := txt.Font;
txt.ClientWidth := Canvas.TextWidth(txt.Text)+6;
RichViewEdit1.AdjustControlPlacement2(txt);
end;
There is one problem: AdjustControlPlacement2 does not update item resizer. It will be fixed in the next update.
-
- Posts: 104
- Joined: Mon Nov 26, 2007 1:49 pm
-
- Posts: 104
- Joined: Mon Nov 26, 2007 1:49 pm