Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF input type/dialog box?

Tags:

c#

wpf

I am trying to take a single input from the user and delete some information form the grid which i display. So for this i want to raise a input box/dialog box which accepts the text and when i hit the button on the dialog box,i want to save the data.

Is it possible with out creating a new window or usercontrol ?

like image 418
Macnique Avatar asked Aug 23 '11 20:08

Macnique


People also ask

What is dialog in WPF?

A message box is a dialog box that can be used to display textual information and to allow users to make decisions with buttons. The following figure shows a message box that asks a question and provides the user with three buttons to answer the question. To create a message box, you use the MessageBox class.

What is a StackPanel WPF?

A StackPanel allows you to stack elements in a specified direction. By using properties that are defined on StackPanel, content can flow both vertically, which is the default setting, or horizontally.

What is modal and modeless dialog box in C#?

Modal dialog boxes, which require the user to respond before continuing the program. Modeless dialog boxes, which stay on the screen and are available for use at any time but permit other user activities.


2 Answers

If you mean something like VB 6 Microsoft.VisualBasic.Interaction.InputBox there is nothing out of the box for both WinForms and WPF.

But of course many people coming from Delphi and VB6 are missing this you can find a lot of ready solutions in the Internet, for instance: http://www.codeproject.com/KB/edit/InputBox.aspx

like image 176
michalczerwinski Avatar answered Sep 28 '22 20:09

michalczerwinski


To my knowledge there is no built-in dialogue for input (aside from MessageBox). You could create a window on the fly though if you do not want to subclass it. Just create a new window instance in code and set its Content to have some default Buttons (OK & Cancel) and a TextBox.

like image 29
H.B. Avatar answered Sep 28 '22 18:09

H.B.