Home > Back-end > Graphic wrap text control problem
Graphic wrap text control problem
Time:10-01
Made a call ShapeButton controls The class PACKAGE TShapeButton: public TCustomControl There are two problems in use process 1, draw in Paint function word use DrawText (Canvas - & gt; Handle, Caption. C_str (), the Caption. The Length (), & amp; TextRect, DT_VCENTER | DT_CENTER | DT_SINGLELINE); How can I like normal Label space, in the Text assignment can identify in the string "\ r \ n"?
2, the program generated dynamically ShapeButton, every time to restart the program will be unable to connect TShapeButton. The obj mistakes, this component directly will drag form then compiled ones can get through it, what's the solution?
CodePudding user response:
The first question, DrawText function of the last parameter, remove the DT_SINGLELINE went, what do you mean by know SingleLine,
DrawText (Canvas - & gt; Handle, Caption. C_str (), the Caption. The Length (), & amp; TextRect, DT_VCENTER | DT_CENTER);
Second question, call the ShapeButton project, a line is added in the unit: # pragma link "ShapeButton "Have a try