Solved

Using A TUpDown Component

Posted on 1999-01-11
2
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
martin_g earned 70 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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