How to make a menu in Visual C++?

Tell me how to make a menu in Visual C++ (it is necessary that it is approximately like in Delphi, that is, the form, buttons and other elements). How to implement this in C? Or tell me what literature it is in.

Author: Nicolas Chabanovsky, 2011-03-03

5 answers

The first step is to install Visual C++ Express. Then, using the project wizard, create a suitable one. If you select a dialog application, it will be almost like in Delphi: a form, buttons, and so on.

 3
Author: stanislav, 2011-03-03 20:09:02

Add a "menu" resource, give it an ID, then in the dialog box where you want to add a menu, in the properties of this window, select the desired ID of the resource menu.

 1
Author: xDrake, 2011-03-04 10:07:01

To create full-fledged window applications, you must have all the usual controls, such as buttons, sliders, status bars, switches, etc.; you must have a full-fledged development environment, an IDE, as mentioned above, Visual C++.

Placing such elements in the working window of the project, as well as creating the window itself, does not cause difficulties, but the semantic content of your elements will require a little additional knowledge and skills, certain features of the development environment itself, such as working by sending messages between elements and processing them through the message map, processing mouse clicks, tracking the cursor location, etc. In general, along with the "basic" knowledge of the language standard, it is also necessary to study the specifics and methods of working in the development environment itself, the features of the various elements and the principles of their relationship. Recent versions of development environments, such as Visual Studio 2010, by the way, they provide a fairly rich set of auxiliary services that significantly facilitate the task of designing and creating a modern application.

 1
Author: ttiimm, 2011-03-04 11:28:12

WinAPI, you can also try to start writing in C#.

 0
Author: Сергей, 2011-03-03 19:58:15

I tried to do {[4] in SFML in C++ ]}

 #include "stdafx.h"
 #include "SFML/Graphics.hpp"

#include <windows.h>

//#include <MMSystem.h>
//#include <Iostream>

using namespace sf;
int x, y, s;
int main()


 {
RenderWindow window(sf::VideoMode(350, 490), "MENU");
while (window.isOpen())

{   sf::Event event;
    while (window.pollEvent(event))
    {
        if (event.type == sf::Event::Closed)
            window.close();
    }

  if (Keyboard::isKeyPressed(Keyboard::Up)){
        s = s + 1; 

        if (s = 0){ s = 3; }
        if (s = 4){ s = 1; }
        window.clear(sf::Color::Black);


        if (s = 1){

            Texture menu1texture; // пехаем проверку внутри нажатия чтоб 
 исключить дискотеку спрайтов
            menu1texture.loadFromFile("C:/111/MY_GAME/MENU001.JPG");
            Sprite menu1sprite;
            menu1sprite.setTexture(menu1texture);
            menu1sprite.setTextureRect(IntRect(0, 0, 350, 490));//получили 
 нужный нам прямоугольник с меню
            //herosprite.setPosition(0, 0);  //выводим спрайт в позицию x y 
            window.draw(menu1sprite);
            window.display();
            menu1sprite.setPosition(0, 0);  //выводим спрайт в позицию x y
        }


        if (s = 2){

            Texture menu2texture;
            menu2texture.loadFromFile("C:/111/MY_GAME/MENU002.JPG");
            Sprite menu2sprite;
            menu2sprite.setTexture(menu2texture);
            window.draw(menu2sprite);
            window.display();
            menu2sprite.setPosition(0, 0);  //выводим спрайт в позицию x y
        }


        if (s = 3){
            Texture menu3texture;

            menu3texture.loadFromFile("C:/111/MY_GAME/MENU003.JPG");
            Sprite menu3sprite;
            menu3sprite.setTexture(menu3texture);
            window.draw(menu3sprite);
            window.display();
            menu3sprite.setPosition(0, 0);  //выводим спрайт в позицию x y
                        }
        Sleep(1000);

    }







         if (Keyboard::isKeyPressed(Keyboard::Down)){ 
    s = s - 1;
    if (s = 0){ s = 3; }
    if (s = 4){ s = 1; }
    window.clear(sf::Color::Black);

        if (s = 1){

        Texture menu1texture;  // пехаем проверку внутри нажатия чтоб 
        исключить дискотеку спрайтов
        menu1texture.loadFromFile("C:/111/MY_GAME/MENU001.JPG");
        Sprite menu1sprite;
        menu1sprite.setTexture(menu1texture);
        menu1sprite.setTextureRect(IntRect(0, 0, 350, 490));//получили 
     нужный нам прямоугольник с меню
        //herosprite.setPosition(0, 0);  //выводим спрайт в позицию x y 
        window.draw(menu1sprite);
        window.display();
        menu1sprite.setPosition(0, 0);  //выводим спрайт в позицию x y
    }


    if (s = 2){

        Texture menu2texture;
        menu2texture.loadFromFile("C:/111/MY_GAME/MENU002.JPG");
        Sprite menu2sprite;
        menu2sprite.setTexture(menu2texture);
        window.draw(menu2sprite);
        window.display();
        menu2sprite.setPosition(0, 0);  //выводим спрайт в позицию x y
    }


    if (s = 3){
        Texture menu3texture;

        menu3texture.loadFromFile("C:/111/MY_GAME/MENU003.JPG");
        Sprite menu3sprite;
        menu3sprite.setTexture(menu3texture);
        window.draw(menu3sprite);
        window.display();
        menu3sprite.setPosition(0, 0);  //выводим спрайт в позицию x y

    }

    Sleep(1000);
}









 }



    return 0;
}
 0
Author: user292758, 2018-04-06 09:53:04