Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

gotoxy(5,10)


  • Please log in to reply
5 replies to this topic

#1 irancplusplus

irancplusplus

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 68 posts
  • Programming Language:C++, C#

Posted 28 November 2011 - 12:17 AM

Hi
in a Console C# program, is there any method which can send the cursor to a point in console window? for example
System.foo.gotoxy(10,20);
System.Console.Write("hello);
will write hello in row 10, column 20?
  • 0

I wrote t.me/cplusplus/203


#2 CommittedC0der

CommittedC0der

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1065 posts
  • Programming Language:C#
  • Learning:C#, JavaScript, PL/SQL

Posted 29 November 2011 - 02:42 PM

Will this help you? mousemove - Simulating mouse movement (C#) - Stack Overflow

~ Committed.
  • -1
There IS a war going on for your mind.
Nothing of eternal significance happens besides prayer.

#3 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 29 November 2011 - 05:50 PM

I think he meant the console user interface cursor, not the graphical user interface mouse cursor.
  • 0

#4 irancplusplus

irancplusplus

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 68 posts
  • Programming Language:C++, C#

Posted 29 November 2011 - 06:01 PM

hi
thanks
using IDE Code Completion
I found this:
Console.SetCursorPosition(5,10);

It works.
  • 0

I wrote t.me/cplusplus/203


#5 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 29 November 2011 - 06:53 PM

@CommittedCoder: But it is a good resource, I think; I didn't even know that C# programs can import Win32 API functions.

Now I wonder about memory management for some of them - for example, the WriteFile () function requires a pointer to a buffer, along with the size of the buffer; not sure about how C# handles strings and buffers.
  • 0

#6 CommittedC0der

CommittedC0der

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1065 posts
  • Programming Language:C#
  • Learning:C#, JavaScript, PL/SQL

Posted 29 November 2011 - 08:54 PM

I think he meant the console user interface cursor, not the graphical user interface mouse cursor.

Good catch.

Now I wonder about memory management for some of them - for example, the WriteFile () function requires a pointer to a buffer, along with the size of the buffer; not sure about how C# handles strings and buffers.



For the Win32 APIs? Not sure, I don't work with API very much, sorry. :/
~ Committed.
  • 0
There IS a war going on for your mind.
Nothing of eternal significance happens besides prayer.




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download