简体   繁体   中英

Strange Button Behavior

My form has several textboxes and several buttons. The textboxes are loaded with data by the load event. If I make changes to the textboxes and then move the cursor over a button, the textboxes are suddenly loaded again with the original information. I don't click a button. I just move the mouse over one. Why is this happening and how do I stop it?

This cannot happen by itself. I suggest you check all event-settings.

For instance, you could have, by accident, linked the Load event to the Button's OnMouseEnter or something like that.


After your comment:

You should absolutely not use the paint event to initialize things. The paint event will be called after every change in the Form.

So move that code to the Load event.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM