Holding button high, when switching pages on LCD ?

Programing withe Arduino Mega + LCD Th

Say you have a program with ex 4 pages. If activating one button on page 2, so that it becomes HIGH. How to keep this button high even if you leave the page?

How my program works now. Button works 100% correctly in its page. It goes on when touched and off when touched again. But if I switch back one page and then go to the page where i pressed the button HIGH, the button is reset.

Normally this is what we want. But I need the program to remember that the button should be HIGH as long as activated.

What I have so fare:

// Button:

if ((x>=229) && (x<=310) &&(y>=40) && (y<=70))
{
if(startButton == false )
{
startButton =true;
drawStartButton(229, 40, 310, 70);
// drawStartButtonOriginal(229, 40, 310, 70);

delay(50); //delay for screen debounce
}
else
{
startButton = false;
checkLastU1 = 2;

// drawStartButton(229, 40, 310, 70);
drawStartButtonStart(229, 40, 310, 70);
delay(50); //delay for screen debounce
}

}

// The functions:

void drawStartButton(int x1, int y1, int x2, int y2)
{
while (myTouch.dataAvailable()) // funksjonen blir inni her…
myTouch.read();
myGLCD.setColor(0, 73, 250); // blå
myGLCD.fillRoundRect (x1, y1, x2, y2);
myGLCD.setColor(255, 255,255); // kvit
myGLCD.drawRoundRect (x1, y1, x2, y2);
myGLCD.setFont(BigFont);
myGLCD.setBackColor(0, 73, 250); //
myGLCD.print(“Start”, 230, 47);
}

void drawStartButtonStart(int x1, int y1, int x2, int y2)
{
while (myTouch.dataAvailable()) // funksjonen blir inni her…
myTouch.read();
myGLCD.setColor(0, 255, 0); // grønn
myGLCD.fillRoundRect (x1, y1, x2, y2);
myGLCD.setColor(255, 255,255); // kvit
myGLCD.drawRoundRect (x1, y1, x2, y2);
myGLCD.setFont(BigFont);
myGLCD.setBackColor(0, 255, 0); //
myGLCD.print(“Start”, 230, 47);

}

How to keep this button high even if you leave the page?

Keeping a pin HIGH or LOW makes sense. Keeping a "button" high does not.

I do not understand why your functions to draw buttons have while loops that appear to read from the touch screen. The act of drawing on the screen is independent of where, and whether, the screen is touched.

It appears, though, that you need to determine/keep track of the state of the application and redraw the correct button.