I have a TDBEdit where users enter a temperature value, usually something like "-40°C" or "+32°F". Pasting the deg-symbol has always been a PITA, so I've added a small SpeedButton above the edit control which will paste the symbol with the following:
But when control is passed back to EditTemp, the cursor is now at the beginning instead of the end. How do I force it to the end so it's in the right place when the the user presses 'F' or 'C'?
Roo
Delphi Rules!
Code:
procedure TTenCvnForm.DegBtnClick(Sender: TObject);
begin
if pos('°', EditTemp.Text) < 2 then
EditTemp.Text:= EditTemp.Text + '°';
ActiveControl:= EditTemp;
end;
Roo
Delphi Rules!