Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TUpDown min, max, and position

Status
Not open for further replies.

Fluke026

Programmer
Aug 20, 2002
32
0
0
US
I have a form where the min and max of a TUpDown change according to the options selected. A user could set the position and then change the options making his position setting out of the range. I have discovered that Delphi automatically moves the position to the new min or max but the associated TEdit does not reflect this change. How can I make the TEdit show the correct position?

Example:
Code:
begin
   case rgOptions.ItemIndex of 
      0: begin
         updRoll.min:= 4; 
         updRoll.max:= 12;
      end;
      1: begin
         updRoll.min:= 4; 
         updRoll.max:= 20;
      end;
      2: begin
         updRoll.min:= 13; 
         updRoll.max:= 20;
      end;
      3: begin
         updRoll.min:= 15; 
         updRoll.max:= 20;
      end;
   end; {case}
end; {proc}
 
One suggestion might be to to check the value within the TEdit control - if the value is smaller than the minimum then set it to the minimum-allowed value - and the same trick for the maximum - if the value is larger than the maximum then set the value to the maximum constraint.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top