-
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!!! :confused:
-
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.
-
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
-
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.
-
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!!!
-
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!!