Problem with ToolBarEx/Menu

Posted on 2012-08-30
Medium Priority
Last Modified: 2012-08-31
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:
(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

Question by:allelopath
  • 4
  • 2
LVL 13

Accepted Solution

LIONKING earned 2000 total points
ID: 38354328
I'm gonna go out on a limb here and say that "maybe" the target platform (x86 or x64) has something to do with it, although I doubt you haven't checked that.

On the other hand, if you're using the ProGUI controls, the .Net programming languages are not officially supported, which means expect weird behavior.

Have you tried building your solution in the Debug mode and running the .exe it creates? Does it show correctly?

Author Comment

ID: 38354534
I did check the target platform. There were some anomalies and I changed everything to AnyCPU, but this did not fix the problem.

Author Comment

ID: 38354683
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:
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 13

Expert Comment

ID: 38354818
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.

Author Comment

ID: 38354893
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
LVL 83

Expert Comment

ID: 38355414
What functionality of this control do you need which is not available in built in menu?

Author Comment

ID: 38355936
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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question