[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using A TUpDown Component

Posted on 1999-01-11
2
Medium Priority
?
293 Views
Last Modified: 2010-04-06
I dropped a TUpDown named UpDown1 component onto a form and associated it to a TPanel named Panel1.  I thought that once I associated UpDown1 to Panel1 that when the user clicks on the up or down arrows the value displayed in Panel1.Caption would automatically be updated to the correct value.  I realize that UpDown1.Property contains the current value, but I thought the association would update Panel1.Caption.  The end result is that it doesn't.  What do I need to do to get the Panel1.Caption to show the correct value.  I have inserted no code into any of UpDown1's methods.  When the user clicks on the arrows nothing happens.
0
Comment
Question by:tecmaster
2 Comments
 
LVL 1

Accepted Solution

by:
martin_g earned 280 total points
ID: 1355965
Don't associate it with UPDown (there may be a bug in the VCL).  It will work if you don't.  Try this code:

procedure TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);
begin
Panel1.caption :=Inttostr(UpDown1.position);

end;
0
 

Author Comment

by:tecmaster
ID: 1355966
Thanks for the answer.  I original used a TLabel to show the count, but since you cannot associate it with the TUpDown I decided use the TPanel instead.  Guess I should of just left the the things the way they were.

Tecmaster
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question