1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

Visual C++

Discussão em 'Programação' iniciada por metRo_, 22 de Agosto de 2007. (Respostas: 0; Visualizações: 1149)

  1. metRo_

    metRo_ Power Member

    Estou a fazer o tutorial do visual c++ 2008 express edition.

    Para começar pede para:
    To create a new Windows Forms control project

    1. From the File menu, click New, and then click Project….
    2. On the Project Types pane, select CLR in the Visual C++ node, and then select Windows Forms Control Library in the Visual Studio installed templates pane.
      Type a name for the project, such as clickcounter.
      Type a different name for the solution, such as controlandtestapp.
      You can accept the default location, type a location that you want, or browse to a directory where you want to save the project.
    3. The Windows Forms Designer opens and shows an area where you add the controls that you want to position on the control design surface.
    Quando pedem isto Windows Forms Control Library suponho que seja Windows Forms aplication, visto que é a coisa mais parecida com isto que aparece, certo?!

    ----------------------------------------------------------------------------------------
    To set the properties of a user control

    1. If you cannot see the Properties window, from the View menu, click Properties Window.
      Click on the control to select it and set its properties as follows:
      • Set the Size property to 100, 100.
      • Set the BorderStyle to Fixed3D
        The label boundaries will be visible after you position the control in an application.
    2. If the Toolbox window is not visible, select Toolbox from the View menu.
      Drag a Label control from the Toolbox to the design surface and position it near the middle of the control.
      Set these properties for the label:
      • Set the BorderStyle to FixedSingle.
      • Set the Text to the digit 0 (zero).
      • Set the Autosize to False.
      • Set the Size to 30, 20.
      • Set the TextAlign to MiddleCenter.
      Leave the Name property (how you refer to it in code) unchanged as label1. The control should resemble the following:
      [​IMG]
    3. Add an event handler for the label Click event (the default event for a label) by double-clicking the label.
    4. The clickcounter.hfile is displayed in the editing area with an empty event handler method.
      [​IMG]Note: If you need more room, close the Toolbox or Properties window by clicking the appropriate Close box or by unpinning the window so that it auto-hides.
    5. Move the cursor to after the opening brace of the label1_Click method, press Enter, and type:

      Código:
      int temp = System::Int32::Parse(label1->Text);
      temp++;
      label1->Text = temp.ToString();
      IntelliSense displays a list of valid choices after you type a scope resolution operator (::), dot operator (.) or arrow operator (->). You can highlight an item and press Tab or Enter or double-click an item to insert that item into your code.
      Also, when you type an opening parenthesis for a method, Visual Studio displays valid argument types for each overload of the method.
    No ponto um eles chamam control à Form certo?! ou haveria de haver alguma coisa a chamar-se control?!
    Outra coisa quando eles mandam criar o evento neles abre um ficheiro .h do genero: clickcounter.h.

    e a mim abre Form1.h....

    Porque o programa até faz o que eles criam mas apartir daqui começa a não criar uma coisa que supsotamente devia de criar....

    Se alguem me puder ajudar....

    Abraços
     

Partilhar esta Página