Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I add controls to the C# MessageBox?

Could I add some custom control to the standard Message Box for read input value, for example text fields for user name and password, or I should create custom winform with "Ok,Cancel" buttons and text fields?

Related: Which control to use for quick text input (inputbox)?

like image 421
jitm Avatar asked Dec 10 '22 13:12

jitm


2 Answers

you can use the Interaction.InputBox method wich is located in the Microsoft.VisualBasic namespace

try this

 Microsoft.VisualBasic.Interaction.InputBox("Enter a Value Here", "Title", "Your Default Text",200,100);
like image 134
RRUZ Avatar answered Dec 23 '22 05:12

RRUZ


You will need to create a custom WinForm to do this. You can make it work the same way as a MessageBox by returning a DialogResult on the Show method.

like image 33
rein Avatar answered Dec 23 '22 07:12

rein