Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 12-11-2003
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Código:
TrackBar.Min := -20;
TrackBar.Max := 20;

...

procedure TForm1.TrackBarChange(Sender: TObject);
var
  Value: Double;

begin
  Value := TrackBar.Position / 10;
  Edit.Text := FloatToStr(Value);
end;

procedure TForm1.EditChange(Sender: TObject);
var
  Value: Double;

begin
  Value := StrToFloatDef(Edit.Text, -10);
  if (Value >= -2) and (Value <= 2) then
    TrackBar.Position := Trunc(10*Value);
end;
Y si tu versión de Delphi no tiene la función StrToFloatDef la defines tú mismo:

Código:
function StrToFloatDef(S: String; Def: Double): Double;
begin
  try
    Result := StrToFloat(S);
  except
    Result := Def;
  end;
end;
// Saludos
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 17:03:22.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi