Thread: Highlight a row only!!

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    15

    Exclamation Highlight a row only!!

    i am C++ user.i am creating a own menu which able the user to use arrow key to select their choice using arrow keys, up and down....but the problem is i cannot highlight their choice...how am i going to do this?? i just wanna to hightlight the selection part only....
    i am using MinGW compiler in window XP and the program is run in Win32 console mode.
    thankyou!!!

  2. #2
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203
    There is some function like settextcolor(int) and setbkcolor(int). But I don't even remember where it was, or any other detail;s and you had to redraw the entire screen or atleast that particular line in order to achieve the effect.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    196
    well i dont know about ming gw but if you go to dev-c++ in the examples they have a menu which is pretty good check it out

  4. #4
    1479
    Join Date
    Aug 2003
    Posts
    253
    I believe what you may be looking for is SetConsoleTextAttribute(). There may be a better way of doing this but this is the only way I can think of. Since you probably have the color of your text already set up, probably white by default, changet the back ground color of the text. You can do that by doing this SetConsoleTextAttribute(BACKGROUND_RED). The best way I can think of doing what you want to do is make a COORD variable to keep track of where the cursor is and if its over text change the color, but that can be time consuming if your not carefull and don't pay attention to where you put the menu options.
    Knowledge is power and I want it all

    -0RealityFusion0-

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    15
    Ya....i think wat i get wat i want now...i will use SetConsoleTextAttribute(BACKGROUND_RED)....so far so good....just i need to adjust to position...thanks all!!!

  6. #6
    Registered User
    Join Date
    Sep 2005
    Posts
    15
    but that is a problem.....how am i going to keep track with the cursor??? when i SetConsoleTextAttribute(BACKGROUND_RED), i need to cout << something , only it will change the colour of the background...wat if i dun wan to cou<< something???izzit using gotoxy??? then set the y postion?? thanks!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tetris
    By estoyperdida in forum C Programming
    Replies: 8
    Last Post: 01-30-2008, 01:02 PM
  2. highlight a row in list box
    By wayne in forum C++ Programming
    Replies: 1
    Last Post: 05-26-2005, 05:55 PM
  3. reading pictures and array
    By sunoflight77 in forum C++ Programming
    Replies: 0
    Last Post: 05-09-2005, 03:16 PM
  4. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 05:37 AM
  5. Is there a bug in this part of my algorithm for connect 4?
    By Nutshell in forum Game Programming
    Replies: 8
    Last Post: 04-28-2002, 01:58 AM