P
Pavan
Hi
I'm creating a Toolbar using shared-addin in Visio-2003.Toolbar contains a
Combo box. The combobox should display the tooltip on change of each item in
the list. I have handled changeevent but still event is not fired.
Here is the code attached for the referecne:
********************************
CommandBar oStandardBar = null;
private Hashtable hashTable = new Hashtable();
public static int iPrgId = 0;
CommandBarComboBox cmbSecurityClass = null;
Object oMissing = System.Reflection.Missing.Value;
oStandardBar = (oVisio.ActiveDocument.Application.CommandBars as
CommandBars).Add("IAMToolbar", MsoBarPosition.msoBarTop, Type.Missing, true);
oStandardBar.Protection =
Microsoft.Office.Core.MsoBarProtection.msoBarNoResize
iPrgId++;
cmbSecurityClass =
(CommandBarComboBox)oStandardBar.Controls.Add(MsoControlType.msoControlDropdown, oMissing, oMissing, oMissing, true);
cmbSecurityClass.AddItem("One",oMissing );
cmbSecurityClass.AddItem("Two",oMissing );
cmbSecurityClass.AddItem("Three",oMissing );
cmbSecurityClass.Caption =
dsLabel.Tables["locStrings"].Rows[0]["secureity_class"].ToString();
cmbSecurityClass.Style = MsoComboStyle.msoComboLabel;
cmbSecurityClass.ListIndex = 0;
cmbSecurityClass.Tag = "cmbSecurityClass_Tag" + iPrgId.ToString();
cmbSecurityClass.Change += new
Microsoft.Office.Core._CommandBarComboBoxEvents_ChangeEventHandler(cmbSecurityClass_Change);
hashTable.Add(oStandardBar.GetHashCode(),oStandardBar);
// Change Event
private void cmbSecurityClass_Change(CommandBarComboBox ctrl)
{
if(ctrl.Text != "")
{
switch(ctrl.text)
{
case "One":
ctrl.TooltipText = "You have selected one";
break;
case "Two":
ctrtl.TooltipText = "You have selected two";
break;
default:
ctrl.TooltipText = "you have selected three";
break;
}
}
}
Any help on this is highly appreciated
Thanks
Pavan
I'm creating a Toolbar using shared-addin in Visio-2003.Toolbar contains a
Combo box. The combobox should display the tooltip on change of each item in
the list. I have handled changeevent but still event is not fired.
Here is the code attached for the referecne:
********************************
CommandBar oStandardBar = null;
private Hashtable hashTable = new Hashtable();
public static int iPrgId = 0;
CommandBarComboBox cmbSecurityClass = null;
Object oMissing = System.Reflection.Missing.Value;
oStandardBar = (oVisio.ActiveDocument.Application.CommandBars as
CommandBars).Add("IAMToolbar", MsoBarPosition.msoBarTop, Type.Missing, true);
oStandardBar.Protection =
Microsoft.Office.Core.MsoBarProtection.msoBarNoResize
iPrgId++;
cmbSecurityClass =
(CommandBarComboBox)oStandardBar.Controls.Add(MsoControlType.msoControlDropdown, oMissing, oMissing, oMissing, true);
cmbSecurityClass.AddItem("One",oMissing );
cmbSecurityClass.AddItem("Two",oMissing );
cmbSecurityClass.AddItem("Three",oMissing );
cmbSecurityClass.Caption =
dsLabel.Tables["locStrings"].Rows[0]["secureity_class"].ToString();
cmbSecurityClass.Style = MsoComboStyle.msoComboLabel;
cmbSecurityClass.ListIndex = 0;
cmbSecurityClass.Tag = "cmbSecurityClass_Tag" + iPrgId.ToString();
cmbSecurityClass.Change += new
Microsoft.Office.Core._CommandBarComboBoxEvents_ChangeEventHandler(cmbSecurityClass_Change);
hashTable.Add(oStandardBar.GetHashCode(),oStandardBar);
// Change Event
private void cmbSecurityClass_Change(CommandBarComboBox ctrl)
{
if(ctrl.Text != "")
{
switch(ctrl.text)
{
case "One":
ctrl.TooltipText = "You have selected one";
break;
case "Two":
ctrtl.TooltipText = "You have selected two";
break;
default:
ctrl.TooltipText = "you have selected three";
break;
}
}
}
Any help on this is highly appreciated
Thanks
Pavan