Board index » cppbuilder » TUpDown problem

TUpDown problem


2004-06-09 12:55:11 AM
cppbuilder48
I have a TUpDown, and when I click it, I do a ShowMessage(). After I close
the popup message, the next time I click the mouse anywhere on the form, the
TUpDown acts like I have clicked on it for a second time. So if the current
TUpDown position is 3, and I click the "UP", it displays '4', I do a
ShowMessage to display a warning, close the Message dialog, click the mouse
somewhere on the form, and the TUpDown is now on 5 (should still be on 4).
What causes this ?
I did try setting the focus to a different control before calling
ShowMessage().
Thanks!
Doug
 
 

Re:TUpDown problem

Hi there
We have encountered a problem with the TUpDown component.
Create a new application, but on the form a TEdit, a TUpDown and a
TButton component
in the on click event of the TButton put
ShowMessage("Button");
in the on click event of the TUpDown put
ShowMessage("UpDown");
and assosiate the TEdit with the TUpDown.
Now run the application.
Click on the button, and a message box with "Button" will show
Click on the up part of the updown component, and a message box with
"UpDown" will show.
Now click on the main button again....
The down button of the updown component is depressed, the editbox value
decrease and the message box with "UpDown" appears. Why is this??? I
did not click on the updown component???
(*)if you click on the button again, the value in the edit box
decrement, but NO message box pop up.
if you click on the button again, then the message box with "Button"
will show again.
I have changed the min value of the TUpDown to something like -10, then
the "UpDown" message will show until -10 is reached in the edit box,
whereafter the same sequence will happen as shown in (*).
If, however, you use the keyboard, i.e. the button have focus and you
press the enter key, no problem occurrs. It seems as if it has got
something to do with the focus of the mouse
Can anyone give me any explanation for this.
Thanks
Conrad Smith