-
Graphic Dissapearing?
I had this problem with my checkers game too! :mad:
Whenever I put too many buttons on the screen, the pic dissapears....heres the code I want to work:
Code:
a=133;
for(i=1;i<=5;i++) {
for(i=1; i<=5; i++) { //draws all buttons (by x, y has its own variable (a))
Board[1][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 5, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
Board[2][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 45, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
Board[3][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 85, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
Board[4][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 125, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
Board[5][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 165, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
a=a+40;
}
}
but that makes my graphic dissapear!
but it will appear if I use this...but I need the whole board! :mad:
Code:
a=133;
for(i=1;i<=5;i++) {
for(i=1; i<=5; i++) { //draws all buttons (by x, y has its own variable (a))
Board[1][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 5, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
Board[2][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 45, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
Board[3][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 85, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
// Board[4][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 125, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
// Board[5][i] = CreateWindow("Button", " ", WS_CHILD | /*WS_DLGFRAME |*/ WS_VISIBLE, 165, a, 40, 40, ghWnd_Main, NULL, hInstance, NULL);
a=a+40;
}
}
does anyone know a reason? basically it seems too many controls makes my pictures dissapear! :(
-
pictures??
which pictures?
-
The one I have on my window :rolleyes: sorry :) would you like to see my whole code?
-
Yeah, might be useful. Basically Win32 should be able to handle up to 2³² - 2 windows (handles are 32-bit unsigned integers, and 0 and (UINT)-1 are invalid (NULL and INVALID_HANDLE_VALUE)). It also shouldn't have anything to do with pictures...
-
thats what I thought...but I tried using a different HINSTANCE variable and it worked....thanks for your help though :)