BCB5: TRAYICON controls, problems, and countermeasures

zhaozj2021-02-17  26

BCB5: TRAYICON controls, problems, and countermeasures

I personally think that the function of this control is not bad, supports multiple self-selected icons, moving speed adjustable, and it is easy to use. But today I listened to my friends, I found that it has a small problem!

[Usually use]: It usually associates it with a pop-up menu, uses it to control the pop-up of the menu, which is its main feature, with an ImageList control to store the pictures it use. If you run a good program in Win98, it is possible to encounter the following problem.

[Question]: When Win98 (Win ME has not been experiment), the so-called "point 2" phenomenon, that is, the first point it (usually set to right click), the menu is ejected, at this time, you don't want to select the menu The options are hidden in other parts of the mouse point (such as a desktop), and the pop-up menu is hidden. Now, right-click on the tray icon TRAYICON, the menu should be popped up again! Oh, it didn't. Wait for you to point it again, this menu is only popped up! Obviously, this is not normal, it should not, although it is a small problem.

[Countermeasure]: Set the Animate property of the Trayicon control to True, everything is OK! If you want a still icon, don't move, this Animate property is still set to true, just deleting other pictures stored in the ImageList control, as you keep the one. Otherwise, they will automatically loop animation.

【other】:

[1] - If there are 2 pictures in ImageList, when the Animate is set to True, observe the IconIndex property, and when this property is selected, the value is changing, indicating the current picture, the interval is determined by the animateInterval value. Note that the modified Animate property will not take effect immediately, it takes effect when the next time it turns on.

[2] - Once Animate is True and has taken into force, it cannot be set to empty, and can no longer delete the ImageList control, otherwise a series of AV (access conflicts), only the task manager is used to force the BCB Oh, huh, huh. Even if you change the Animate to false, you can't do it right away. Don't forget to modify the animate value to take effect next time! So it will do this after turning off the project.

转载请注明原文地址:https://www.9cbs.com/read-28617.html

New Post(0)