C
C#•7mo ago
bellic | A33 5G

Input Box in C#

Hi. I would like to know how to get an input box in C# please
51 Replies
TheRanger
TheRanger•7mo ago
in what, webforms? winforms? wpf? asp.net ? razor ? blazor ? avalonia?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Winforms
TheRanger
TheRanger•7mo ago
did you create the input box first? $details
MODiX
MODiX•7mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
bellic | A33 5G
bellic | A33 5GOP•7mo ago
No I want to get it from VB
TheRanger
TheRanger•7mo ago
VB? do u mean the designer mode?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
I said
using Microsoft.VisualBasic
using Microsoft.VisualBasic
But Interaction does not pop up as an option No I want to get an InputBox through code
TheRanger
TheRanger•7mo ago
winforms itself has an InputBox
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Really wacky question, have you used a language called Delphi before?
TheRanger
TheRanger•7mo ago
no, but what does this have to do with winforms?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
How do I get it? See C# and Delphi are very similar
TheRanger
TheRanger•7mo ago
do you want to create it programatically or through designer mode?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Through program code Not designer
TheRanger
TheRanger•7mo ago
bellic | A33 5G
bellic | A33 5GOP•7mo ago
And through designer?
TheRanger
TheRanger•7mo ago
no, link only shows how to create one programatically
Insire
Insire•7mo ago
Visual basic has a dialog window, that holds a single textbox, which is called inputbox. i believe they want to use that and not write their own
bellic | A33 5G
bellic | A33 5GOP•7mo ago
You see Delphi was just simple
userinput := inputbox('Hello', 'World', '');
userinput := inputbox('Hello', 'World', '');
Window title, Prompt, Input
Insire
Insire•7mo ago
here is how to get access to that https://stackoverflow.com/a/97156
Stack Overflow
What is the C# version of VB.NET's InputBox?
What is the C# version of VB.NET's InputBox?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Been trying to do that It does not work
bellic | A33 5G
bellic | A33 5GOP•7mo ago
No description
Insire
Insire•7mo ago
you'll have to be more specific than that. what does work?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Interaction.InputBox does not work Importing VB does
Insire
Insire•7mo ago
how does it not work? do you get an error? what error do you get?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
No description
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Does not appear in IntelliSense
Insire
Insire•7mo ago
works over here
No description
Insire
Insire•7mo ago
and also runs
No description
Insire
Insire•7mo ago
what .NET version are you using?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
How do I check? I just installed it last night So should be latest version?
Insire
Insire•7mo ago
installed what? Visual Studio?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Yes
Insire
Insire•7mo ago
Visual Studio is an IDE, it comes with different .NET Versions, based on which release you download install. right now, you get .NET 8 i didnt use .NET 8 for the sample i showed, but .NET Framework 4.7.1
bellic | A33 5G
bellic | A33 5GOP•7mo ago
I think mine is 4.7.2 iirc
Insire
Insire•7mo ago
which comes with windows 10 and 11 by default did you add the assembly reference to Microsoft.VisualBasic like the SO link described?
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Yes Look in my screenshot It is there
Insire
Insire•7mo ago
none of your screenshots show assembly references. they show some using statements among your code
bellic | A33 5G
bellic | A33 5GOP•7mo ago
using Microsoft.VisualBasic;
using Microsoft.VisualBasic;
Insire
Insire•7mo ago
this is where you can see assembly references
No description
Insire
Insire•7mo ago
thats a using statement
bellic | A33 5G
bellic | A33 5GOP•7mo ago
No description
Insire
Insire•7mo ago
and this is how you check your .NET version for your project
No description
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Does not look like it is there
Insire
Insire•7mo ago
yes, so you need to add it
bellic | A33 5G
bellic | A33 5GOP•7mo ago
How?
Insire
Insire•7mo ago
check my SO link
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Thank you Is it bad to copy someone else's input box design? 😂
Insire
Insire•7mo ago
its kinda bad to use inputbox and winforms
bellic | A33 5G
bellic | A33 5GOP•7mo ago
Where can I find some good ones?
Insire
Insire•7mo ago
and VB good what? what are you trying to do? if you are trying to build a desktop application for windows, then i recommend using WPF
bellic | A33 5G
bellic | A33 5GOP•7mo ago
I'm just playing around
Want results from more Discord servers?
Add your server