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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to resize the control on the runtime? 1

Status
Not open for further replies.

caster

Programmer
Jan 3, 2003
32
IN
Hi all;
I want to increas the height of the control on the runtime depending upon the size of the text that is being displayed in it.
I want to get the size of the text in PIXELS.
Note : I don't want to use GetDisplayHeight.
 
I take it you're not using version 6 then? There is one down and dirty way to handle this, if you're not concerned about the space left on the page, etc. In the control to expand, do this in the OnRead method:

If Len(me.DataValue) > 36 Then
'The Length will vary depending on the text font, etc.
gGrowControl = TRUE
'gGrowControl is global boolean variable
End If

If gGrowControl Then
ME.size.height = 605 ' .42 * 1440 twips per inch
End If


Also, in the Frame containing the control, you can, if needed, increase its height as well; in the AdjustSize method:

If gGrowControl Then
size.height = 605 ' .42 * 1440 twips per inch
End If


Actuate uses twips for determining the height of controls, not pixels.
 
First of all Thanks a lot bcaslow for your keen interest.
I've designed a logic like this by my self. But what actually want is some kind of function like GetDisplayHeight() which give you the required height of the control to display the full text of the control.GetDisplayHeight works only on WINDOWS platform I want a generic function which can work on any platform.

Thanks A Lot
CAS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top