InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working
InvalidateControl is not working InvalidateControl is not working
InvalidateControl is not working
Go Back  Xtreme Visual Basic Talk > > > InvalidateControl is not working


Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2011, 03:31 PM
Alex30 Alex30 is offline
Regular
 
Join Date: Sep 2007
Posts: 51
Default InvalidateControl is not working


Hello,
I have created shared add-in for Office. The shared add-in creates ribbon tab with combobox and refresh button.

When shared add-in loads, it sets default text in combobox. The user can change combobox value.
When user clicks on "refresh" button, the default text should be set in combobox.

After long search in WEB I've found InvalidateControl method that resets ribbon control. There are many available examples, but it doesn't work for me.

Here is my code:
Code:
Private myRibbon As IRibbonUI

    Public Function comboGetText(ByVal control As Office.IRibbonControl) As String
        'setting combo default text
        Dim strText As String
        Select Case control.Id
            Case "firstCombo" : strText = "Hi"
            Case "secondCombo" : strText = "Bye"
            Case Else : strText = "Hi"
        End Select
        Return strText
    End Function

    Private Sub ribbonLoaded(ByVal ribbon As IRibbonUI)
        'Getting and setting ribbon controls values
        myRibbon = ribbon

    End Sub

Sub refreshPressed(ByVal control As Office.IRibbonControl)      
        myRibbon.InvalidateControl("firstCombo")
        myRibbon.InvalidateControl("secondCombo")

       
    End Sub
Reply With Quote
  #2  
Old 11-07-2011, 04:34 AM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Alex,
I'm not on a computer that has VS installed or for that matter MS Office...

See if the following blog entry can help You out:
http://www.excelguru.ca/blog/2009/06...ures%E2%80%A6/

You may also test to see what the outcome will be if You test with Refresh instead of Invalidate.
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
  #3  
Old 11-09-2011, 12:22 PM
Alex30 Alex30 is offline
Regular
 
Join Date: Sep 2007
Posts: 51
Default

Dennis, thanks a lot.
The link was very helpful.
It works now!!!
Reply With Quote
  #4  
Old 11-09-2011, 01:11 PM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Great Alex It looks like You have managed to do the framework now with the add-in Goodl luck with the rest and You know where to ask if You find Yourself in troubles again.
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working InvalidateControl is not working
InvalidateControl is not working
InvalidateControl is not working
 
InvalidateControl is not working
InvalidateControl is not working
 
-->