How to make the user select a value and retrieve it? - vsto

I have a dynamic list of values that I want the user to select from, how is it possible to do it with VSTO ? Would it be possible to prompt a listbox (as a MessageBox ?) and retrieve the selected item ? Or could I add a listbox in the Ribbon ?
Thank you for your help

Have you tried to add DropDown/ComboBox control to ribbon bar?
Alternatively, perhaps you could create a custom windows form and place the control on it. Then attach that form to an event, add-in start, button click, etc.

Related

Access and modify the Textbox's ContextMenu Items

I'm using vb.net 2013.
Is there any way to access and modify the TextBox's context menu items ?
I want to hide some of these items.
And I want to translate the caption.
Thank you !
Yes there is. Example below, where you hide based on a condition that you have set.
if (yourCondition) then
yourTextBox.ContextMenuStrip.Items.RemoveByKey(theNameOfTheStrip)
end if
I'm not sure what you mean by the caption (but i think it is the text)
yourTextBox.ContextMenuStrip.Items.Item(theIndexOrKeyHere).Text

Deselect single item on click in VBA userform listbox control

can anybody point me in the right direction to achieve this?
VBA - UserForm - ListBox Control (single selection):
Usually, if you click on listboxe's item, then you select it. If you click on the same item again, you just select it again.
I would like to make the second click deselect the item, instead.
The listbox is programmatically created.
Is there a way to do this?
Thank you,

List Custom Button IDs in Outlook 2010 Inspector Ribbon

I have an inspector in Outlook 2010 that contains a button that was placed in the Show group in the ribbon. The inspector current item is an appointment item. The form that this button originally belonged to no longer exists but, the button remains in the Show group and there is no documentation on this button. Is there a way to list all of the buttons by ID that are in the current ribbon? I'm looking to find the ID of this button so I can set enabled to false in my XML but, have had no luck thus far.
EDIT: To be a little more precise, I'm looking to loop through all of the elements in the ribbon in Outlook so I can find the correct ID of a button I want to remove from it. I'm using C#, .NET 4.0 and VSTO for the add-in.
Answering this myself in case anyone needs it.
You can use HideFormPage("Button Name") to hide the orphaned button placed in the ribbon by a custom form. There is no need to loop through the ribbon and find it.
Application.ActiveInspector.HideFormPage("Button Name");

Turn off field programmatically in VB.Net

I'm creating an addin button in Arcmap via VB.net that when clicked, runs the identify tool. But I want only selected fields to appear in the identify dialog. I thought of hiding the unnecessary fields and then showing them again after the button is used.
Does anyone know how to programmatically turn off/on field?
you have to iterate the fields in layer and then set visible property into false .
see this link in
gis.stackExchange

Silverlight 4 - how can I make text box to have cursor active in it?

I have multiple text boxes on a silverlight page. How can I make one of them active so that I will not have to click it to be able to type into it.
You could try
textBox1.Focus();
This tries to bring the focus over your textbox.
EDIT:
I assume that you want to select your textbox when the page is loaded. In this situation you nead to bring the focus to the silverlight plug-in first and after that to call Focus() method of your textbox.
Here a way to do this:
System.Windows.Browser.HtmlPage.Plugin.Focus();