Home > Back-end >  Ask you a question about the interface
Ask you a question about the interface

Time:10-06

On the interface placed an Edit and a UpDown. Don't set the Associate association; According to the UpDown when realizing the increasing or decreasing; The code is as follows:

 
Void __fastcall TForm1: : UpDown1Click (TObject * Sender, TUDBtnType Button)
{
If (StrToInt (Edit3 - & gt; The Text) & lt; UpDown1 - & gt; Min)
{
UpDown1 - & gt; The Position=UpDown1 - & gt; Min.
}
If (btNext==Button)
This - & gt; Edit3 - & gt; Text=UpDown1 - & gt; The Position + UpDown1 - & gt; Increment;
The else
This - & gt; Edit3 - & gt; Text=UpDown1 - & gt; The Position - UpDown1 - & gt; Increment;
}

For example, I set the UpDown value range is 10-100 when I was smaller than 10 inputs, found that the increasing number of jumps over 10 to 11 and I want to directly when the input is less than 10 from 10 increase, if the range is far more direct incremental;

CodePudding user response:

Added an Increment in the first if the back add a else, put in the behind of the if - else statements as a whole

CodePudding user response:

reference 1st floor dataxdata response:
added an Increment, behind the first the if and else, put behind the if - else statements as a whole in


So you can't not letter can try, when 10 this value will stop, the other at the time of the input number is more than 10 in return the most began to enter the time less than 10 is the number of more than 10; I don't want to use the Associate properties

CodePudding user response:

Input number smaller than 10, the UpDown1 - & gt; As you enter the number of the Position

CodePudding user response:

reference songhtao reply: 3/f
, smaller than 10 inputs the UpDown1 - & gt; The Position set for the number you entered
I tried
  • Related