none
Combo Boxes "hover" over comments in Excel VSTO RRS feed

  • Question

  • So I have a load of combo boxes assigned to cells in an Excel 2010 VSTO C# project.

    The problems come when I try to view comments as the comments appear BEHIND the combo boxes.  This means that 90% of my comments are only partially visible from their default locations.  I can move them to read the contents, but I would much rather be able to have them appear in front of the combo boxes.

    I have tried using Control.SentToBack to put my combo boxes at the bottom of the Z-Order, but that didn't help.  I suppose this is because Excel treats Windows Control differently from Excel controls?

    Wednesday, March 28, 2012 5:14 PM

All replies

  • Hi Diksta,

    Thanks for posting in the MSDN Forum.

    It's based on my experience thtat you needn't set Z-Order. You just need defocused combobox.

    Please look the screen shooting, I hope it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 29, 2012 4:24 AM
    Moderator
  • Hi Tom,

    I am not sure what you mean by "defocused", my ComboBoxes don't have focus and yet they still appear on top of comments.  Here is a screenshot as this might help understand the problem.

    As you can see there are multiple comboboxes but they all appear on top of my comment.

    Comments appear behind comboboxes

    Thursday, March 29, 2012 10:51 AM
  • Hi Diksta,

    It's based on my experience that the controls you show me is Winforms controls. And the screen shootings which I shown to you is VBA control. I would recommend you use VBA controls instead of Winforms controls in your Excel document.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, March 30, 2012 5:24 AM
    Moderator
  • Nope, they are actually Excel comboboxes (although they look identical to WinForms ComboBoxes).  I can't/ won't use VBA comboboxes, this is a VSTO question, if I wanted to use VBA (which I don't) then I guess I wouldn't have this problem in the first place?
    Friday, March 30, 2012 11:59 AM
  • Hi Diksta,

    I think I know you mean. The comboBox is under Microsoft.Office.Tools.Excel.Controls namespace. Is it right? And I think it's hard to address your goal. I will involve some experts into this issue to help you. There might be some time delay, thanks for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 2, 2012 10:04 AM
    Moderator
  • Yes, that is exactly what I am using...

    I do have a workaround (not a pretty one though); if I move the combo boxes so they appear at the far left of my Excel worksheet then they will still be shown above comments but there will be no comments to be obscured in that part of the sheet.

    I guess I could also tell users that if they want to read comments then they will have to drag them "away" from the combo boxes to be able to do so.

    Anyway, I will wait with anticipation to see if your experts can come up with a solution!

    Monday, April 2, 2012 10:37 AM
  • Hi Diksta,

    As alternative could you programmatically set the Left property of the ComboBox some number of measurements (pixels, inches - what ever works ) to the Left of the cell range? This would solve the issue without suggesting to the end-user that she drag the controls.

    Regards,
    Chris Jensen
    Senior Technical Support Lead


    Chris Jensen

    Wednesday, April 4, 2012 3:37 PM
    Moderator
  • Hi Chris,

    Now that is a really good idea - I will try that now and see how it looks.  I already programatically resize the comment box to prevent it from becoming too wide and to auto-fit the comment text, so this would fit in very nicely (as I can guarantee the maxium width of the comment boxes).

    Many thanks.

    Wednesday, April 4, 2012 3:57 PM
  • Nope that didn't work, the position the comments appear when they are hovered stays the same.

    If you "Show Comments" then they appear in the right place, if you hover them then they ignore the Left property.

    In this example my cursor is hovering over the 15.2 figure but the comment for 15.1 has been "shown" and appears in the correct place.

    Hovering Comments ignores the actual position

    Wednesday, April 4, 2012 4:50 PM
  • Hi Diksta,
    I thought the problem was the Combo Boxes blocking the Comments. The programmatic suggestion was to move the Combo Boxes to the left. I'm confused by your diagram. Where are the Combo Boxes and why are we seeing two comments when you hover above one cell? That doesn't happen on my worksheet.

    Regards,
    Chris Jensen
    Senior Technical Support Lead


    Chris Jensen

    Thursday, April 5, 2012 3:27 PM
    Moderator
  • Hi Chris,

    If you had read my post you would see that the comment on the right is a "pop up" comment that appears when you hover a cell.  The one on the left is a "shown" comment, i.e. I clicked the cell and then chose Show Comment from the Ribbon. This is why there are two comments on the screen at the same time.

    I was showing why the "move the comment" solution doesn't work.  This is why there are no combo boxes in the diagram, there are some in the other diagram I attached to an earlier post.  The point is that a "shown" comment appears where you have moved it, in my case to the left of the cell it belongs to, whereas a pop up cell ignores this position and always appears slightly to the right of the cell.

    I have done a lot more research into this and it just looks like it is just another bug in Excel.  I have seen some VBA "fixes" that involve clicking in the cell and launching a macro to intercept the "pop up".  In the end I took the decision that combo-boxes were just too broken to use with Excel.  There are loads of other problems with them: they don't scroll properly (they sort of "jump" all over the screen when you scroll), they don't render correctly (they appear with incorrect fonts, too large, etc.), they don't save correctly with the workbook (they turn into bitmaps!), they lose their tags randomly, etc.  I have taken them out and have put in a worse solution (but one that actually works).


    • Edited by Diksta Thursday, April 5, 2012 9:29 PM
    Thursday, April 5, 2012 9:29 PM