473,426 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

Automatically resize textbox height to fit contents on form

63
In Access 2007, I'm using bound textboxes on a continuous form to display the contents of each record's memo field. Is there a way to automatically adjust the textbox height to fit the contents?

Thanks in advance.
Dec 24 '08 #1
1 18457
missinglinq
3,532 Expert 2GB
No, there is no way to "automatically" do this. I think it would require some rather complicated code, wherein you figure, given your font size and width of your memo field's textbox, how many characters could fit in a line, how many lines you need and set the height accordingly. And after doing all this, on a Continuous form, when you change the height of the textbox on RecordA, the height of the textbox on all records would be changed!

A better solution would be to allow the user to expand the textbox on a given record, using the acCmdZoomBox command. You could use this in a number of events, but the DoubleClick event is frequently used

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourControl_DblClick(Cancel As Integer)
  2.   DoCmd.RunCommand acCmdZoomBox
  3. End Sub
as well as the GotFocus event.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourControl_GotFocus()
  2.   DoCmd.RunCommand acCmdZoomBox
  3. End Sub
Welcome to Bytes!

Linq ;0)>
Dec 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Jaeger | last post by:
I have jpeg images that are 2848 x 4256 pixels. I want to programatically convert them to images that are approximately 427 x 638 (that maintains the ratio) and save to new jpeg files. How can...
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
1
by: Kalvin | last post by:
I am using a nested table to control different elements of my layout. The problem I have is that I create the outer table and set the size properties to what I want them to be, then, if I put...
1
by: al | last post by:
Greetings, I included a UserControl (UC)on webpage. It works fine except when I change document direction to 'rtl', UC doesn't resize with the rest of document. It just disappears behinde rest...
2
by: DraguVaso | last post by:
Hi, I have to DataGrid's on a form, one on the top of my form, the other at the bottom, but they though each other somewhere in the middle. What I want now is that, when I resize the form, they...
1
by: ramhog | last post by:
Hello all, I am trying to resize a textbox to exactly fit the contents. The method I am using gets it close but it is just a little bit too small. Could someone tell me where I am going wrong...
8
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me...
1
by: Bob Alston | last post by:
I have a system where many subforms are used. Often the size of the subform had to be larger than could be displayed without scrolling. I set the height of the subform to the typical height...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.