Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

new to c++ help

Name: Anonymous 2012-05-01 0:37

fix this
    private: System::Void trackBar1_Scroll(System::Object^  sender, System::EventArgs^  e) {
                 lbl1->Text = trackBar1->Value.ToString();
                 Form1->opacity = trackBar1->value.ToString();

Name: Anonymous 2012-05-01 4:37

#pragma once

namespace helloworldwindows {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;

    /// <summary>
    /// Summary for Form1
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: Add the constructor code here
            //
        }

    protected:
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }
    private: System::Windows::Forms::Label^  lbl1;
    private: System::Windows::Forms::Button^  button1;
    private: System::Windows::Forms::Button^  button2;
    private: System::Windows::Forms::TrackBar^  trackBar1;

    protected:

    private:
        /// <summary>
        /// Required designer variable.
        /// </summary>
        System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void InitializeComponent(void)
        {
            this->lbl1 = (gcnew System::Windows::Forms::Label());
            this->button1 = (gcnew System::Windows::Forms::Button());
            this->button2 = (gcnew System::Windows::Forms::Button());
            this->trackBar1 = (gcnew System::Windows::Forms::TrackBar());
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar1))->BeginInit();
            this->SuspendLayout();
            //
            // lbl1
            //
            this->lbl1->AutoSize = true;
            this->lbl1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
                static_cast<System::Byte>(0)));
            this->lbl1->Location = System::Drawing::Point(12, 9);
            this->lbl1->Name = L"lbl1";
            this->lbl1->Size = System::Drawing::Size(0, 31);
            this->lbl1->TabIndex = 0;
            //
            // button1
            //
            this->button1->Location = System::Drawing::Point(12, 227);
            this->button1->Name = L"button1";
            this->button1->Size = System::Drawing::Size(75, 23);
            this->button1->TabIndex = 1;
            this->button1->Text = L"&Change";
            this->button1->UseVisualStyleBackColor = true;
            this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
            //
            // button2
            //
            this->button2->Location = System::Drawing::Point(197, 227);
            this->button2->Name = L"button2";
            this->button2->Size = System::Drawing::Size(75, 23);
            this->button2->TabIndex = 2;
            this->button2->Text = L"E&xit";
            this->button2->UseVisualStyleBackColor = true;
            this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
            //
            // trackBar1
            //
            this->trackBar1->Location = System::Drawing::Point(15, 107);
            this->trackBar1->Maximum = 100;
            this->trackBar1->Name = L"trackBar1";
            this->trackBar1->Size = System::Drawing::Size(257, 45);
            this->trackBar1->TabIndex = 3;
            this->trackBar1->Scroll += gcnew System::EventHandler(this, &Form1::trackBar1_Scroll);
            //
            // Form1
            //
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(284, 262);
            this->Controls->Add(this->trackBar1);
            this->Controls->Add(this->button2);
            this->Controls->Add(this->button1);
            this->Controls->Add(this->lbl1);
            this->Name = L"Form1";
            this->Text = L"Form1";
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->trackBar1))->EndInit();
            this->ResumeLayout(false);
            this->PerformLayout();

        }
#pragma endregion
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                 lbl1->Text = "hello world!";
             }
    private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
                 Application::Exit();
             }
    private: System::Void trackBar1_Scroll(System::Object^  sender, System::EventArgs^  e) {
                 lbl1->Text = trackBar1->Value.ToString();
                 Form1->opacity = trackBar1->value.ToString();
             }
};
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List