1

I have a CommandBarControl and on the click of this control, I want to get a number as user input.

private void oControlHandler_Click(object CommandBarControl, ref bool Handled, ref bool CancelDefault)
{
//get a number as user input

//do some work on input
}

How to get user input? I am using VS 2013 and .NET framework 4.0.

KatariaA
  • 752
  • 1
  • 7
  • 22
  • Where is your user typing in the user input? Do you have another textbox on your screen or do you want to popup for them to use? – Scott Wylie Sep 02 '15 at 04:46
  • I would like to use a small pop up when user clicks on the control. – KatariaA Sep 02 '15 at 05:06
  • What type of app is this for, WinForms, WPF, specific add in? Are you referring to the CommandBarControl in Office 2013? Of the Visual Studio CommandBarControl for extensions – Scott Wylie Sep 02 '15 at 05:15
  • It is a Visual Studio(2013 to be specific) Addin that gets shown on the right click at any place in code. – KatariaA Sep 02 '15 at 05:19

1 Answers1

1

You need to create a Windows Forms (or WPF) form with a control to enter the input, which can be a TextBox or some kind of NumericUpDown. Then, on the Click event you show the form modally (ShowDialog). Notice that your question is not related to Visual Studio add-ins.

Carlos Quintero
  • 4,300
  • 1
  • 11
  • 18
  • thanks Carlos. I am going to create a dynamic form in WPF. Can you suggest some links for creating it in C#. – KatariaA Sep 03 '15 at 04:48