Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / April 2007

Tip: Looking for answers? Try searching our database.

Combobox .change event stops work after a while??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karsten_Markmann - 26 Apr 2007 14:48 GMT
Hi
I am building a large application where we use the combobox feature a
lot.
Its an office addin for office XP.
I am using Visual studio 2003 VB.

In outlook and excel it works perfect all the time, but in Word it
stops work after a randomly amount of time?
(The Event ".Change" does apparently not fire).
Does anyone have some ideas what can cause this problem?

Below are some code snippets from my application.
Any help appriciated.

Kind Regards:
Karsten Markmann

<GuidAttribute("9132AA66-FDA6-4023-BCEB-75BA61D2997C"),
ProgIdAttribute("KiCSystem.Connect")> _
Public Class Connect

   Implements Extensibility.IDTExtensibility2
   Private WithEvents cmbSearchCoveo As CommandBarComboBox
----

   cbrNewToolbar = KiCData.hostApp.CommandBars.Add(Name:="KiC LRØ
system 2", Position:=msoBarTop, Temporary:=True)
----

   cmbSearchCoveo =
cbrNewToolbar.Controls.Add(Type:=MsoControlType.msoControlComboBox)
           With cmbSearchCoveo
               .BeginGroup = True
               .Visible = True
               .Style = MsoComboStyle.msoComboLabel
               .Caption = "Fritekst søgning:"
               .TooltipText = "Fritekst søgefelt i KiC systemet.
Søger i alle dokumenter efter det skrevne."
               .Tag = "SearchCoveo"
           End With

----

Private Sub cmbSearchCoveo_Change(ByVal Ctrl As
Microsoft.Office.Core.CommandBarComboBox) Handles
cmbSearchCoveo.Change

       ShowIEURL(HTTPSEARCH & cmbSearchCoveo.Text)

   End Sub
---
Cindy M. - 27 Apr 2007 15:43 GMT
Hi Karsten_Markmann,

> I am building a large application where we use the combobox feature a
> lot.
[quoted text clipped - 5 lines]
> (The Event ".Change" does apparently not fire).
> Does anyone have some ideas what can cause this problem?

Difficult to tell, but it looks like you didn't declare the object
variable for the toolbars and buttons at the class level? If you do
not, they'll eventually be garbage collected.

The other thing to watch out for is that you should assign a unique
string value to the controls' TAG property. Word uses this (with its
MDI UI) to keep track of what window you're currently in.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
Karsten_Markmann - 30 Apr 2007 12:07 GMT
I have tried this now, but still having trouble?
The following is the start of my conect class:
Isn't this what you mean?
I alse have different tags for the buttons.

Option Explicit On

Imports Microsoft.Office.Core

Imports Extensibility
Imports System.Runtime.InteropServices
Imports System.Drawing
Imports System.Windows.Forms
Imports System.IO

<GuidAttribute("9132AA66-FDA6-4023-BCEB-75BA61D2997C"),
ProgIdAttribute("KiCSystem.Connect")> _
Public Class Connect

   Implements Extensibility.IDTExtensibility2
   Private WithEvents cmbSearchCoveo As CommandBarComboBox
   Public WithEvents cmdFindKiC As
Microsoft.Office.Core.CommandBarButton
   Private WithEvents cmbFindKiC As
Microsoft.Office.Core.CommandBarButton
   Private WithEvents cmbSaveEmailKiC As
Microsoft.Office.Core.CommandBarButton
   Private WithEvents cmbSkabelonerKiC As
Microsoft.Office.Core.CommandBarButton
   Private WithEvents cmbSearchCoveoButton As
Microsoft.Office.Core.CommandBarButton
   Private cbrNewToolbarPrivate As CommandBar

-----
Cor Ligthert [MVP] - 30 Apr 2007 12:37 GMT
Karsten,

I an not (yet) known with using Microsoft.office in VB.Net.

However be aware that an event in a combobox in VB.Net will often result
that he calls himself again (recursive) a good reason that your program
stops because the combobox has eaten all your memory.

Cor

>I have tried this now, but still having trouble?
> The following is the start of my conect class:
[quoted text clipped - 30 lines]
>
> -----

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.