| |

VerySource

 Forgot password?
 Register
Search
View: 957|Reply: 9

How to modify the display color of its corresponding control (such as a button) through the pointer?

[Copy link]

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-15 06:00:01
| Show all posts |Read mode
For example: I have obtained the "pointer" of a (CButton) button. How can I use this pointer to modify the display color of the corresponding button?
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-6-19 23:15:01
| Show all posts
I think it can be achieved by subclassing the control in response to ON_CtlColor
Reply

Use magic Report

1

Threads

7

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-21 07:00:01
| Show all posts
First subclass the control, like the response message upstairs. Add a flag, judge the flag in the response function, and change the color when the conditions are met. When you need to change, get the pointer and change the flag.
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 India

 Author| Post time: 2020-6-21 10:00:01
| Show all posts
All I can control is this pointer!
Reply

Use magic Report

0

Threads

14

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-7-22 19:45:01
| Show all posts
Subclassing can
The button color should be self-painted
OnCtlColor cannot be changed
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-24 11:30:01
| Show all posts
The button I'm talking about is the button of other programs, not the current program.
Reply

Use magic Report

0

Threads

14

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-7-26 09:15:01
| Show all posts
First insert the program remotely, and then change it in the same way
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-26 11:00:01
| Show all posts
?? Insert the program remotely?? Have not tried, what do you mean?
Reply

Use magic Report

0

Threads

3

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-29 11:15:01
| Show all posts
GetDC
Then SetBKColor()
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-7-29 19:00:01
| Show all posts
Change the button color, as if only subclassing
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