LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default BackStyle Property misbehavior

Greetings,

Sorry for crosspost. Figured maybe more appropriate here than
M.P.Excel where I tried yesterday...or does the question even
make sense?

The sequence below works to create and then set options on
CommandButton1, Label1 and Frame1 objects - *except* that
the visual effect of BackStyle is not seen.

Public Sub addLabel()
Sheet2.OLEObjects.Add "Forms.Label.1", _
Left:=100, Top:=75, Height:=15, Width:=200
End Sub

Public Sub nameLabel()
Sheet2.Label1.Name = "title1"
End Sub

Public Sub setLabel()
Sheet2.title1.BackStyle = 0
Sheet2.title1.Caption = "My Text"
Sheet2.title1.Font.Bold = 1
Sheet2.title1.Font.Italic = 1
Sheet2.title1.Font.Size = 12
End Sub


However, the value *is* set correctly per the script when I look at the
object properties after the sheet is created and all these objects added.

Changing the property manually in the properties dialog *on those
objects created by the script* also has no visual effect - the
label/button/frame keeps it's white background.

OTOH, if I add a Label manually, I can set BackStyle to 0 and it
immediately becomes transparent.

All other properties (except size/location) are identical to the
manually-created 'control' that does accept and reflect the value of
BackStyle.

Saving and re-opening the file doesn't change appearance or behavior any.

What am I missing, beyond that it smells like a bug? By the way, I have
the same behavior on excel 2000 and 2003 and on several different machines.

Side question - Add say a Command1 button manually to the sheet from the
toolbar. Right-click on it to get to the menu with 'properties' on it.
It seems to be hit-or-miss whether the full menu or an abbreviated one
without 'Properties' comes up. Do these things have 'hot' areas that
produce different menus? Or what?

TIA - Lynn.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel misbehavior PhillyRon Excel Discussion (Misc queries) 4 November 13th 08 01:38 PM
Enter key misbehavior dredrunde Excel Discussion (Misc queries) 1 January 15th 07 06:49 PM
Problem setting BackStyle on Label Lynn. Rickards Excel Discussion (Misc queries) 0 January 7th 06 03:07 PM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM
Checkbox BackStyle Bug or Not? TheRave.NET Excel Programming 1 October 23rd 03 01:50 PM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"