Problem with Panel

Hello Everybody!!!

I started new game (Sea Battle) with code. But I have a problem!

I have buttons in my game ("New Game", "Set Player" ... and so on)

My question is the following...
If we click button "New Game", can I shift NewGame panel????
Please help me((
Last edited on
????
firstly are you doing it in c++? which header files u use? ....
post some parts of code...
If we click button "New Game", can I shift NewGame panel????

<shout>YES, you can!!!</shout>

But seriously: What language? GUI (windows/dialogs)? CLI (console)? Muldimedia framework (opengl, directx, sfml, ...)?
Some code would be nice, too. And last but not least: a clear question.
yes in c++
My code is :

#include <windows.h>
const char g_szClassName[] = "myWindowClass";
#define ID_BUTTON1 1
#define ID_BUTTON2 2
#define ID_BUTTON3 3
#define ID_BUTTON4 4
#define ID_BUTTON5 5
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
switch(msg){
case WM_CREATE:{
CreateWindow(TEXT("BUTTON"), TEXT("New Game"),
WS_VISIBLE | WS_CHILD ,
120, 80, 80, 25,
hwnd, (HMENU) ID_BUTTON1, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("Set Player"),
WS_VISIBLE | WS_CHILD ,
120, 120, 80, 25,
hwnd, (HMENU) ID_BUTTON2, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("Records"),
WS_VISIBLE | WS_CHILD ,
120, 160, 80, 25,
hwnd, (HMENU) ID_BUTTON3, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("About"),
WS_VISIBLE | WS_CHILD ,
120, 200, 80, 25,
hwnd, (HMENU) ID_BUTTON4, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("Quit"),
WS_VISIBLE | WS_CHILD ,
120, 240, 80, 25,
hwnd, (HMENU) ID_BUTTON5, NULL, NULL);
break;
}
case WM_COMMAND:{
if(LOWORD(wParam) == ID_BUTTON1){
//Here I want to show next Panel ...
MessageBox(hwnd, "Button is clicked", "Title of MessageBox", MB_ICONINFORMATION);
}

break;
}
Last edited on
if(LOWORD(wParam) == ID_BUTTON1){
//Here I want to show next Panel (NewGamePanel) ...
}
Topic archived. No new replies allowed.