Click here to Skip to main content
15,913,570 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows ContextMenu... Pin
Guinness4Strength12-Jan-05 13:52
Guinness4Strength12-Jan-05 13:52 
GeneralRe: Windows ContextMenu... Pin
new_phoenix13-Jan-05 9:24
new_phoenix13-Jan-05 9:24 
GeneralDirectX 9 & c# problem Pin
dratcha12-Jan-05 12:28
dratcha12-Jan-05 12:28 
GeneralSimple ListBox Event Pin
Snowjim12-Jan-05 12:27
Snowjim12-Jan-05 12:27 
GeneralRe: Simple ListBox Event Pin
Stefan Troschuetz12-Jan-05 21:41
Stefan Troschuetz12-Jan-05 21:41 
GeneralRe: Simple ListBox Event Pin
Snowjim12-Jan-05 23:21
Snowjim12-Jan-05 23:21 
GeneralRe: Simple ListBox Event Pin
Stefan Troschuetz12-Jan-05 23:30
Stefan Troschuetz12-Jan-05 23:30 
GeneralVS.NET Add-In Problem Pin
Guinness4Strength12-Jan-05 12:13
Guinness4Strength12-Jan-05 12:13 
I've written an Add-in that creates a CommandBar with a CommandBarButton and CommandBarComboBox control. It looks and works great the very first time the add-in is run (when the OnConnection method executes). But if I close VS and re-open it, only the CommandBarButton control is the only control present. Below is the OnConnection method I use to create the CommandBar. Do I need to add the CommandBarComboBox control in a different way ?

public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
	applicationObject = (_DTE)application;
	addInInstance = (AddIn)addInInst;
	if(connectMode == Extensibility.ext_ConnectMode.ext_cm_UISetup)
	{
		object []contextGUIDS = new object[] { };
		Commands commands = applicationObject.Commands;
		_CommandBars commandBars = applicationObject.CommandBars;
		try
		{
			//add command
			Command cmd = null;
			try
			{
				cmd = commands.Item(FullCommandName,0);
			}
			catch(Exception Err)
			{
				Debug.WriteLine("OnConnection: "+Err.Message);
			}
			if(cmd!=null)
				cmd.Delete();
			cmd = commands.AddNamedCommand(addInInstance,CodeDepotRes.ProgID,CodeDepotRes.CommandName,CodeDepotRes.ToolTip,false, 102,ref contextGUIDS,(int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled);
			//add command bar
			CommandBar Bar = GetCommandBar(CodeDepotRes.ProgID);
			if(Bar!=null)
				commands.RemoveCommandBar(Bar);
			Bar=(CommandBar)commands.AddCommandBar(CodeDepotRes.ProgID,vsCommandBarType.vsCommandBarTypeToolbar,null,0);
					
			//add button
			CommandBarButton btn = (CommandBarButton) cmd.AddControl(Bar, 1);
			btn.Style = MsoButtonStyle.msoButtonIcon;

			// Add a drop-down list box to the command bar.
			CommandBarComboBox DropBox = (CommandBarComboBox) Bar.Controls.Add(
						MsoControlType.msoControlDropdown,oMissing,oMissing,oMissing,oMissing);
			DropBox.Width=300;
			// Add items to the list box.
			DropBox.AddItem("[Open Code Depot Manager]",oMissing);
			// Set the caption and style.
			DropBox.Caption = "Snipets:";
			DropBox.Style = MsoComboStyle.msoComboLabel;
		}
		catch(System.Exception Err)
		{
			Debug.WriteLine("OnConnect:"+Err.Message);
		}
	}
			
}


Any thoughts would be greatly appreciated...
GeneralARRAY LIST Pin
suthagar12-Jan-05 10:29
suthagar12-Jan-05 10:29 
GeneralRe: ARRAY LIST Pin
Christian Graus12-Jan-05 10:53
protectorChristian Graus12-Jan-05 10:53 
Generalnot post back Pin
Ahmed Galal12-Jan-05 7:40
Ahmed Galal12-Jan-05 7:40 
GeneralRe: not post back Pin
Christian Graus12-Jan-05 8:56
protectorChristian Graus12-Jan-05 8:56 
GeneralRe: not post back Pin
Ahmed Galal12-Jan-05 10:12
Ahmed Galal12-Jan-05 10:12 
GeneralRe: not post back Pin
Esmo200012-Jan-05 9:54
Esmo200012-Jan-05 9:54 
GeneralList Tables Pin
Dirso12-Jan-05 7:38
Dirso12-Jan-05 7:38 
GeneralNeed assistance with System.Diagnostics.process.startinfo.createnowindow ... Pin
new_phoenix12-Jan-05 7:08
new_phoenix12-Jan-05 7:08 
GeneralByte array to struct Pin
Arjan Schouten12-Jan-05 6:39
Arjan Schouten12-Jan-05 6:39 
GeneralRe: difference between .NET remoting and shared/private assembly? Pin
liyang yu12-Jan-05 5:58
liyang yu12-Jan-05 5:58 
Generalproblem with SQL Pin
ronin177012-Jan-05 5:40
ronin177012-Jan-05 5:40 
GeneralRe: problem with SQL Pin
Steve Maier12-Jan-05 5:45
professionalSteve Maier12-Jan-05 5:45 
GeneralRe: problem with SQL Pin
Jesse Squire12-Jan-05 6:28
Jesse Squire12-Jan-05 6:28 
GeneralRe: problem with SQL Pin
Dave Kreskowiak12-Jan-05 9:02
mveDave Kreskowiak12-Jan-05 9:02 
GeneralConfiguring web service Pin
Esmo200012-Jan-05 4:38
Esmo200012-Jan-05 4:38 
GeneralRe: Configuring web service Pin
Esmo200012-Jan-05 9:57
Esmo200012-Jan-05 9:57 
Questiondifference between .NET remoting and shared/private assembly? Pin
liyang yu12-Jan-05 4:01
liyang yu12-Jan-05 4:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.