Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question Using Dynamic Text controls

Status
Not open for further replies.

jjmew

Programmer
Aug 20, 2002
34
0
0
US
Hi, I am using dynamic text controls. After the control is done i need to know in run-time how many lines that control has. How I can do that?
 
I would have to make some assumptions here, based on what information you have given: such as, this control can grow dynamically to accommodate varying lengths of data?. One way to approach this would be in the Finish method (before the call to Super::Finish() ) of the control.

If your control with one line is .25 inches (base height), then in the finish get the height of the control (me.size.height) and divide by your base:
NbrLines = SafeDivide(me.size.height, .25, 0)
So if ending height is 1.25", you would have 5 lines. (Also, I used inches, but twips is the unit of measure; 1440 per inch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top