Punchinello
Programmer
If you've ever used a TUpDown control with a TEdit field then you've probably noticed that the UpDown button aligns on the outside of the Edit border. Windows, on the other hand, generally shows the UpDown control on the inside of the Edit border, providing a look consistent with that of a combo box. Here's a quick-and-dirty way to do that with Delphi.
1. Place a TEdit and a TUpDown on a form.
2. Set the UpDown1.Associate property to Edit1.
(it will align itself to the outside of Edit1)
3. Place this code in the Form's OnShow event:
4. Run the project. ![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
1. Place a TEdit and a TUpDown on a form.
2. Set the UpDown1.Associate property to Edit1.
(it will align itself to the outside of Edit1)
3. Place this code in the Form's OnShow event:
Code:
UpDown1.SetBounds(Edit1.Left +
Edit1.Width -
GetSystemMetrics(SM_CXEDGE) -
GetSystemMetrics(SM_CXVSCROLL),
Edit1.Top +
GetSystemMetrics(SM_CYEDGE),
GetSystemMetrics(SM_CXVSCROLL),
Edit1.ClientHeight);
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)