paste from clipboard to console-app

J

Jarod_24

I'm working on a console-view for my application wich is kinda a replacement
for the orignal cmd.exe in windows xp.

I could simply use .Write() to do that, but how do i paste the text so that
the user can edit it (just like you can do in command.com and cmd.exe)
 
H

Herfried K. Wagner [MVP]

* "Jarod_24 said:
I'm working on a console-view for my application wich is kinda a replacement
for the orignal cmd.exe in windows xp.

I could simply use .Write() to do that, but how do i paste the text so that
the user can edit it (just like you can do in command.com and cmd.exe)

Have a look at the menthods 'Read' and 'ReadLine' of the 'Console'
class.
 
J

Jarod_24

Herfried K. Wagner said:
Have a look at the menthods 'Read' and 'ReadLine' of the 'Console'
class.


?!

I can't use Read or ReadLine to send text to the console. They are write
protected.

Clipboard -> Console

here's some code

'paste from clipboard out to console-window

'grab what's on the clipboard
Dim p As String =
CType(Clipboard.GetDataObject.GetData(Windows.Forms.DataFormats.StringFormat
, True), String)

'how to write it to the console?
'Console.Write(p) will print out the text in 'p' but would not let the
user edit the text before he presses enter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top