| |

VerySource

 Forgot password?
 Register
Search
View: 886|Reply: 6

Why does the image I bind to TreeView have to go through an event to display correctly

[Copy link]

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-1 12:30:01
| Show all posts |Read mode
Why does the image I bind to TreeView have to go through an event to display correctly

I first defined an imagelist, and added the images.The imagelist property on the TreeView was also bound to the imagelist that I defined, but after the formload event was completed, the root node of the TreeView displayed the first in the imagelist Icon, the icons of its subordinate nodes are correct;
However, after an afterselect event, the icon of the root node returns to normal. What is going on, thank you for your guidance.
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-13 16:30:01
| Show all posts
It may be a refresh problem, try refreshing manually
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-5-14 14:15:01
| Show all posts
The image display of the ImageList bound to the TreeView is problematic. The specific solution is to add a sentence immediately after binding
Application.DoEvent ();

The specific function is to the system Post Message: "I want to draw a picture", the system will draw Image after this
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-5-18 13:15:01
| Show all posts
To枫叶之龙
I am a winform program, how to refresh manually, please advise.

Toyujunziling
Is Application.DoEvent (); written in the last line of the pageload event?
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-5-18 23:30:01
| Show all posts
TreeView.Refresh ()
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-5-19 16:15:01
| Show all posts
Thank you for your advice
I will go home tonight to try
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-6-7 01:45:01
| Show all posts
There is no pageload in the winform program, just write this sentence immediately after the binding statement, and it is OK; there is no obvious binding, just in InitCompoenents();
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list