tags:

views:

90

answers:

3

I want to divide my console screen in four part and each part work separately, I think in this we use thread but I am not getting how to use?

A: 

You can't just divide the console, but you have enough control over it to do it yourself.

See Console class reference. You can SetCursorPosition, set window position and size. Make your own method - something like WriteToArea(int area, string text). Track bounds of areas and wrap text to stay inside of area. Each area must have its own cursor position, track it too. And think how you will handle area overflow (or you need just four columns?)

Edit: I'm not going to give you fish, but here is your fishing rod ^_^

  • Get dimensions of console window (Console.WindowWidth) in columns
  • Divide that by four to get each area's width and calculate start and end column of each area. For example, if your console is 80 columns wide, you should get [0, 19], [20, 39], [40, 59], [60, 79] - these pairs are bounds of each area.
  • Next, store cursor position for each area (initially that would be [left bound, 0])
  • Implement method writeToArea(int area, String text):void. That's the hardest part. First, you SetCursorPosition into stored position for that area. Next, break text into parts that fit into area. Take into account how much space is left on current column. Write text with series of Console.Write, line by line. Then update cursor position for that area [CursorLeft, CursorTop].
  • Write, debug and have fun!
alxx
PLz write the code ,acutally i am not getting
brijesh shukla
i think u got the question ,but i did not get ans.........
brijesh shukla
stop trolling for code, the man gave you PLENTY to go off of.
Firoso
A: 

Well, theres libraries for this sort of thing. But you can't just split up the console window.

If you want more information about the library, check it out at sourceforge.

mkroman
A: 

These answers might help: - http://stackoverflow.com/questions/3434346

Ben Gribaudo