Problem with ToolBarEx/Menu

Posted on 2012-08-30
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
    LVL 13

    Accepted Solution

    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?
    LVL 1

    Author Comment

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

    Author Comment

    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:
    LVL 13

    Expert Comment

    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.
    LVL 1

    Author Comment

    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

    What functionality of this control do you need which is not available in built in menu?
    LVL 1

    Author Comment

    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

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now