Home > Software engineering >  Since the drawing Cbutton
Since the drawing Cbutton

Time:09-27

I use a cbutton creates a derived class will be a button control property to the owner to establish a link between a variable after the draw, debugging is in a state of collapse, can't find the reason, troublesome everybody a great god for help,

CodePudding user response:

Must be rewritten CButton derived class ontouch () function, or complains.

CodePudding user response:

Well find the problem must be rewritten CButton derived class virtual function of the drawitem (), not is not, there is a WM_drawitem, bonus has been the,,,, thank you very much!

CodePudding user response:

Need to rewrite the DrawItem virtual functions

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

CodePudding user response:

Since the draw Button, it is not recommended by processing the owner the draw, but should deal directly with the WM_PAINT message,
Because the Checkbox and radio button is also a CButton, when dealing with the owner after the draw, the Checkbox and radiobutton Checked state, is invalid,

CodePudding user response:

reference 5 floor psbeond reply:
since the draw Button, it is not recommended by processing the owner the draw, but should deal directly with the WM_PAINT message,
Because the Checkbox and radio button is a CButton when dealing with the owner after the draw, the Checkbox and radiobutton Checked state, is invalid,
check the status or to want oneself to get ODS_XXX will not tell you this, how do you draw button when normal, to check the controls, to judge, and then write two button logic, Checked a picture, a picture is not Checked,

CodePudding user response:

Now that chose to custom painting, of course, in order to realize the drawing function,
As long as there is custom painting function will not collapse, not implemented, there will be a frame and the background is not the same,

CodePudding user response:

Many ready-made online button class, study can be downloaded
  • Related