PC Review


Reply
 
 
kirkm
Guest
Posts: n/a
 
      23rd Nov 2008

Anyone know why autosize sometimes increases label height
far in excess of what it should be? It occurs after the label text is
changed to something smaller, then restored to what it was.

Should this logic to reset work?. It isn't!

Set Autosize False
Set label1 = ""
Assign label1= newtextstring
Set Autosize True

Also when autosize causes descenders to be cropped, can you append a
blank line (to the label)?

Thanks - Kirk
 
Reply With Quote
 
 
 
 
OssieMac
Guest
Posts: n/a
 
      23rd Nov 2008
Hi Kirk,

Firstly are you using MS Excel? The code you posted suggests you might be
using something else.

Anyway assuming it is MS Excel your first question: Try setting the property
Wordwrap to false. Excel becomes confused with Autosize if it is set to true
and then font sizes and length of text etc is changed.

Second question: Following code might help if you are using MS Excel.

Dim newtextstring As String

newtextstring = "My New Label Name"

'Label1.AutoSize = False 'Superfluous line.
'Label1.Caption = "" 'Superfluous line. Not required when changing caption
Label1.Caption = newtextstring
Label1.AutoSize = True
Label1.Font.Size = 12 ' Included for demo purposes only

Can also use following line in lieu of using a variable for the caption.
Label1.Caption = "My New Label Name"

Feel free to get back to me if still having problems but let me know what
version of Excel you are using

--
Regards,

OssieMac


"kirkm" wrote:

>
> Anyone know why autosize sometimes increases label height
> far in excess of what it should be? It occurs after the label text is
> changed to something smaller, then restored to what it was.
>
> Should this logic to reset work?. It isn't!
>
> Set Autosize False
> Set label1 = ""
> Assign label1= newtextstring
> Set Autosize True
>
> Also when autosize causes descenders to be cropped, can you append a
> blank line (to the label)?
>
> Thanks - Kirk
>

 
Reply With Quote
 
kirkm
Guest
Posts: n/a
 
      23rd Nov 2008
On Sat, 22 Nov 2008 19:50:00 -0800, OssieMac
<(E-Mail Removed)> wrote:

Hi Ossie

>Firstly are you using MS Excel? The code you posted suggests you might be
>using something else.


Sorry it wasn't actual code... but the things I'd been trying.

You've hit it on the nail... Wordwrap! Everything now works
perfectly... and I was also able to nail the descender problem. I
wasn't turning on the scrollbar at the exact right label Height.

Excel version 2002.

Thanks a million !

Cheers - Kirk
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autosize Error willemeulen Microsoft Excel Misc 0 25th Feb 2010 12:17 PM
autosize =?Utf-8?B?ODVhc2NNY0xhcmVu?= Microsoft Access VBA Modules 0 23rd Aug 2007 02:10 PM
Autosize macro =?Utf-8?B?U3dlZXRKZWJ1cw==?= Microsoft Excel Programming 2 15th Jul 2006 04:06 AM
autosize =?Utf-8?B?TGVhcm5pbmcgdGhlIGhhcmQgd2F5?= Microsoft Excel Programming 2 25th May 2006 02:16 PM
Re: AutoSize Larry Linson Microsoft Access Reports 0 12th Aug 2003 08:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:53 PM.