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

How do I autosize a richtextbox width?

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
Is there a way of making the width of a one line richtextbox grow to suit the width of the characters as they are added. This would have to take care of different size fonts and proportional spacing.
I can do it when adding text thru .seltext by also printing to a dummy form and measuring the text width but this does not work if I fill the richtextbox with .textrtf from a database unless I fill the box, then take the .text out of it, measure it and set the width from that.

I need this for a jumbo scroll across the bottom of a screen.

Incidentally I found that richtextboxes don't jitter when you put them in a frame and scroll the frame with the ccrpTmr6.ocx.
 
Joe,

If you have followed the history of the datat transfer Ted is working on (and it goes back at least a year) I think you'll find that his bottleneck isn't the language he's using.

 
Strongm - I was actually commenting on the perception that a "newer" language has some sort of intrinsic gains in efficiency.

Maybe a comparison to cars rather than people would have been clearer. Most people recognize that newer model cars usually are more efficient in gas mileage, less polution, etc., then older models. I got from Ted's comment that he thought that this might apply for "newer model" programming languages as well.

I was trying to make the point that the choice of programming languages is often more influenced by design goals, architecture, ease of future maintenance, etc., then it is about efficiency. If pure efficiency was the overriding requirement, then you would probably be writing assembly code.

Joe Schwarz
Custom Software Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top