Link to home
Start Free TrialLog in
Avatar of allelopath
allelopath

asked on

Problem with ToolBarEx/Menu

I have a toolbar declared like so:
Me.tbMenu = New SharpLibrary.CommandBars.ToolBarEx()
Then I add menu stuff to it, so it has across the top:
File  Edit Tools Help
and it looks good in the Debug config,but when I switch to Release, these top level words disappear, being replaced by ... like so:
...   ... T... ...

(yes the T is there).
So I thought, for whatever reason, it needs more width in Release, so I increase the width:
Me.tbMenu.Size = New System.Drawing.Size(800, 20)
(The 800 was 650) but this had no effect.
I also tried
- making the font smaller for tbMenu , but the ... just appear smaller.
- making the font smaller for individual menu item, same thing.

As an experiment, I changed the text of the File menu item:
Me.tbiFile.Text = "&File"
to this:
Me.tbiFile.Text = "&FileFile"
and it appears as:
Fil...
(and similarly for the other menu items).
Not sure what that says.

Any idea what the problem is?

Here's all the code for tbMenu:
        Me.tbMenu.AllowFloatingBarHorizontalResize = True
        Me.tbMenu.ArrowColor = System.Drawing.SystemColors.ControlText
        Me.tbMenu.BarType = SharpLibrary.CommandBars.BarType.MenuBar
        Me.tbMenu.CheckedItemColor = System.Drawing.Color.FromArgb(CType(CType(226, Byte), Integer), CType(CType(229, Byte), Integer), CType(CType(237, Byte), Integer))
        Me.tbMenu.DroppedDownItemBorderColor = System.Drawing.SystemColors.ControlDarkDark
        Me.tbMenu.DroppedDownItemColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(217, Byte), Integer), CType(CType(211, Byte), Integer))
        Me.tbMenu.FadedTextColor = System.Drawing.SystemColors.GrayText
        Me.tbMenu.Font = New System.Drawing.Font("Tahoma", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
        Me.tbMenu.GripperColor = System.Drawing.SystemColors.ControlDark
        Me.tbMenu.ImageList = Nothing
        Me.tbMenu.Location = New System.Drawing.Point(11, 0)
        Me.tbMenu.Name = "tbMenu"
        Me.tbMenu.Office2003GradientEndColor = System.Drawing.Color.Empty
        Me.tbMenu.Office2003GradientStartColor = System.Drawing.Color.Empty
        Me.tbMenu.Office2003GripperDarkColor = System.Drawing.Color.Empty
        Me.tbMenu.Office2003GripperLightColor = System.Drawing.Color.Empty
        Me.tbMenu.PressedItemColor = System.Drawing.Color.FromArgb(CType(CType(138, Byte), Integer), CType(CType(150, Byte), Integer), CType(CType(184, Byte), Integer))
        Me.tbMenu.RightSideText = ""
        Me.tbMenu.RightSideTextColor = System.Drawing.SystemColors.ControlText
        Me.tbMenu.RightSideTextHotColor = System.Drawing.SystemColors.Highlight
        Me.tbMenu.SelectedItemBorderColor = System.Drawing.SystemColors.Highlight
        Me.tbMenu.SelectedItemColor = System.Drawing.Color.FromArgb(CType(CType(187, Byte), Integer), CType(CType(194, Byte), Integer), CType(CType(214, Byte), Integer))
        Me.tbMenu.SelectedItemTextColor = System.Drawing.SystemColors.ControlText
        Me.tbMenu.SelectionImageListLeftSide = Nothing
        Me.tbMenu.ShowFloatingToolBar = False
        Me.tbMenu.Size = New System.Drawing.Size(800, 20)
        Me.tbMenu.TabIndex = 0
        Me.tbMenu.TabStop = False
        Me.tbMenu.TextColor = System.Drawing.SystemColors.ControlText
        Me.tbMenu.TextFadingEnabled = False
        Me.tbMenu.ToolBarTitleColor = System.Drawing.SystemColors.ControlText

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Member_2_861731
Member_2_861731
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of allelopath
allelopath

ASKER

I did check the target platform. There were some anomalies and I changed everything to AnyCPU, but this did not fix the problem.
I'm having trouble determining what SharpLibrary is.
Do you think it is part of ProGUI? I don't see it there.
It appears to me to be some very old, now dead, API:
http://dotnetslackers.com/VB_NET/re-13393_SharpLibrary_2_10_Released.aspx
Mmm... Looks like it's not part of the ProGUI, but I couldn't find the company site or anything like it.
If it's very old, I'd assume it's not compatible with "new" technology, therefore you should try to keep your application as simple as possible.
Maybe you should set your configuration to x86 "always", and give it a try. With no documentation it's hard to determine why it behaves the way it does.
I changed it from x86 originally because of a runtime error:
A first chance exception of type 'System.BadImageFormatException' occurred in mscorlib.dll
I switched it back as a test and the error still happens, so it can't be set to x86
What functionality of this control do you need which is not available in built in menu?
That's a question I've asked myself. This is not my code and I've just started with it. It seems that it would be better with just System.Windows.Forms.Menu, but there must be something I haven't seen yet that SharpLibrary is used for.