51 Replies
in what, webforms? winforms? wpf? asp.net ? razor ? blazor ? avalonia?
Winforms
did you create the input box first?
$details
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)
No
I want to get it from VB
VB? do u mean the designer mode?
I said
But Interaction does not pop up as an option
No I want to get an InputBox through code
winforms itself has an InputBox
Really wacky question, have you used a language called Delphi before?
no, but what does this have to do with winforms?
How do I get it?
See C# and Delphi are very similar
do you want to create it programatically or through designer mode?
Through program code
Not designer
you can see an example of creating one here https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.textbox?view=windowsdesktop-8.0
TextBox Class (System.Windows.Forms)
Represents a Windows text box control.
And through designer?
no, link only shows how to create one programatically
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
You see Delphi was just simple
Window title, Prompt, Input
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?
Been trying to do that
It does not work
you'll have to be more specific than that. what does work?
Interaction.InputBox does not work
Importing VB does
how does it not work?
do you get an error? what error do you get?
Does not appear in IntelliSense
works over here
and also runs
what .NET version are you using?
How do I check?
I just installed it last night
So should be latest version?
installed what? Visual Studio?
Yes
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
I think mine is 4.7.2
iirc
which comes with windows 10 and 11 by default
did you add the assembly reference to
Microsoft.VisualBasic
like the SO link described?Yes
Look in my screenshot
It is there
none of your screenshots show assembly references. they show some using statements among your code
this is where you can see assembly references
thats a using statement
and this is how you check your .NET version for your project
Does not look like it is there
yes, so you need to add it
How?
check my SO link
Thank you
Is it bad to copy someone else's input box design? 😂
its kinda bad to use inputbox
and winforms
Where can I find some good ones?
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
I'm just playing around