Results 1 to 5 of 5

Thread: Graphic Dissapearing?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Graphic Dissapearing?

    I had this problem with my checkers game too!

    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!

    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!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    pictures??
    which pictures?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    The one I have on my window sorry would you like to see my whole code?

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    thats what I thought...but I tried using a different HINSTANCE variable and it worked....thanks for your help though

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width