Strange SplitButton Behavior

Add-in Express™ Support Service
That's what is more important than anything else

Strange SplitButton Behavior
SplitButtons not behaving like they are supposed to 
andrew.helgeland




Posts: 51
Joined: 2012-07-20
I have an AIX Toolbar Project that contains a Windows Forms ToolStrip.

On that toolstrip there are a few ToolStripSplitButton(s).

Clicking the arrow to open the DropDown on the split button works fine, but when you click it again to close it, it just stays open, or really quickly opens and closes.

So I made a test Windows Forms application, put a toolstrip on it, put the same buttons am using in it, and the windows forms ToolStripSplitButton works just fine.

Then, just to be sure, before posting this a made another Toolbar Project, put a toolstrip in it with a few split buttons, and they behave the same way as my other toolbar project.

This leads me to believe this problem is coming from AIX.

Interestingly enough, the split button works correctly if it is the FIRST thing in the toolstrip, but nowhere else.

When it is the first thing in the toolstrip and you click the arrow to close it, these two properties are still set to true:
splitButton.DropDownButtonSelected = True
splitButton.Selected = True

However, doing the same thing with the second splitbutton on the strip, those two properties get set to false and are never set back to true until you click something else, then the dropdown arrow again, for some unknown reason.

You can test this yourself in a new toolbar project, add some split buttons to a toolstrip, and have them all use this click method:

        private void SplitButtonDropDownArrow_Click(object sender, EventArgs e)
        {
            ToolStripSplitButton splitButton = (ToolStripSplitButton)sender;
            HTMLDocument.body.innerHTML = "Name = " + splitButton.Name + "<br />" +
                                          "splitButton.DropDown.Disposing = " + splitButton.DropDown.Disposing + "<br />" +
                                          "splitButton.DropDown.AutoClose = " + splitButton.DropDown.AutoClose + "<br />" +
                                          "splitButton.DropDownButtonPressed = " + splitButton.DropDownButtonPressed + "<br />" +
                                          "splitButton.DropDownButtonSelected = " + splitButton.DropDownButtonSelected + "<br />" +
                                          "splitButton.ButtonPressed = " + splitButton.ButtonPressed + "<br />" +
                                          "splitButton.ButtonSelected = " + splitButton.ButtonSelected + "<br />" +
                                          "splitButton.DropDown.Visible = " + splitButton.DropDown.Visible + "<br />" +
                                          "splitButton.DropDown.Disposing = " + splitButton.DropDown.Disposing + "<br />" +
                                          "splitButton.IsOnDropDown = " + splitButton.IsOnDropDown + "<br />" +
                                          "splitButton.Selected = " + splitButton.Selected + "<br />" +
                                          "splitButton.Pressed = " + splitButton.Pressed + "<br />";

}
Posted 28 Dec, 2012 13:40:27 Top
andrew.helgeland




Posts: 51
Joined: 2012-07-20
And since I know this is coming...

VS 2012 Professional (as admin)
AIX For IE Premium (v8.1.5065)
IE 9 (32-bit)
Windows 7 Professional (64-bit)
Posted 28 Dec, 2012 14:51:36 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Andrew,

Toolstrip is very specific control. It works bad in unmanaged applications.
I will try to find a solution for you as soon as possible.
Posted 29 Dec, 2012 07:10:09 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Andrew,

I found a solution. But it works for 'IE Add-on' projects. I used the same solution as described here.
Can you please migrate from the 'IE Toolbar' project to the 'IE Add-on' (with a toolbar) project?
Posted 31 Dec, 2012 07:55:35 Top
andrew.helgeland




Posts: 51
Joined: 2012-07-20
Is there an easy process to "convert" a toolbar project to an "IE Add-on" project, or will I have to do a lot of copy and pasting?

Edit: If you do have a nice list of steps, that'd be great. Otherwise I'll figure it out, don't want to waste your time.
Posted 31 Dec, 2012 09:47:17 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Andrew,

You just need to set the parent class of your toolbar to 'AddinExpress.IE.ADXIEToolbar'. Then you can copy the existing toolbar to the new add-on project. To add the toolbar to the iemodule you can use the 'Toolbars' property. You also need to check the namespace of the toolbar and iemodule. It should be equal.
Posted 01 Jan, 2013 07:02:08 Top
andrew.helgeland




Posts: 51
Joined: 2012-07-20
Unfortunately this is not even close to this simple. There are all kinds of properties that a Toolbar project has that an ADXIEToolbarModule does not have and vice versa. Basically, it's just "deal with it or spend 2 weeks refactoring your project". Not to mention it's already built in to the build process, and I would have to completely re-write my WIX installer project, and the program I wrote to generate all the WIX files.
Posted 18 Jan, 2013 08:48:22 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Andrew,

I will try to implement the add-on features in the 'ADXIEToolbarModule' class (I mean the 'HandleDocumentUICommands' property). But it will be added to the next build. Now I don't have any reliable solution for 'ADX IE Toolbar' projects and the ToolStrip control.
Posted 22 Jan, 2013 06:00:26 Top
andrew.helgeland




Posts: 51
Joined: 2012-07-20
Do you have an estimate of when this next build would release? It would be greatly appreciated if you could add the "OnTab*" and NewWindow events to the ToolbarModule class.

Also, I've made a test project using an IEModule, adding a toolbar, and adding a toolstrip to the toolbar, and split buttons still have this same strange behavior...
Posted 24 Jan, 2013 08:28:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Andrew,

I think that it will be published in February.

Also, I've made a test project using an IEModule, adding a toolbar, and adding a toolstrip to the toolbar, and split buttons still have this same strange behavior...

It happens because you don't use the 'OnUpdateUI' event to close the opened split menu.
Posted 28 Jan, 2013 07:53:24 Top