0

I'm trying to implement a command-line interface inside of a Windows Forms form. I've looked into PDCurses, but I'm not sure if that's where I want to be. What should I do?

2
  • 2
    You want a console window INSIDE a windows form or just say textboxes set up to display and intput to a cmd shell or simply a separate window? Commented Oct 13, 2010 at 22:21
  • yes, that is correct, INSIDE. And I want it formatted, colors, positioning, etc.. Commented Oct 13, 2010 at 22:33

1 Answer 1

2

There are two basic approaches, though I'm not sure which goal you're aiming for:

If you want to have an actual command window inside your app:

  • Create a text box. Let them type whatever they want.
  • When the user hits ENTER, read the current line and use the System.Diagnostic.Process classes to execute that line and retrieve the resulting text.
  • Display the resulting text in your textbox.
  • Optional: Prevent the textbox from getting too large by throwing away lines from the top when it gets too big.

If you want to simply create a custom command-processing window:

  • Find a way to parse the input and provide syntax errors.
  • Create an object model that corresponds to the features your app will make available to your console.
  • Connect the parser/interpreter to your object model.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.