| | |
Combobox connecting problem!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
Hi, i am new to Visual C++ and facing problem in integrating two combo boxes.
Here is what i need:
Combobox1 - Material of Plate:
Choice: Metal or Plastic
Combobox2 - Thickness of Plate:
Choice: if Metal in Combobox1: 2,3,4,5,6
Choice: if Plastic in Combobox1: 8,10,15
I am unable to solve the problem, can any one help me out with the this!...any help is highly appreciated...!
The code is as follows:
#pragma once
namespace Program {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:
ata;
using namespace System:
rawing;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </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::ComboBox^ comboBox1;
protected:
private: System::Windows::Forms::ComboBox^ comboBox2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label4;
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->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// comboBox1
//
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^ >(2) {L"Metal", L"Plastic"});
this->comboBox1->Location = System:
rawing:
oint(142, 34);
this->comboBox1->Name = L"comboBox1";
this->comboBox1->Size = System:
rawing:
ize(71, 21);
this->comboBox1->TabIndex = 0;
//
// comboBox2
//
this->comboBox2->FormattingEnabled = true;
this->comboBox2->Items->AddRange(gcnew cli::array< System::Object^ >(5) {L"2", L"3", L"4", L"5", L"6"});
this->comboBox2->Location = System:
rawing:
oint(142, 62);
this->comboBox2->Name = L"comboBox2";
this->comboBox2->Size = System:
rawing:
ize(71, 21);
this->comboBox2->TabIndex = 1;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System:
rawing:
oint(30, 37);
this->label1->Name = L"label1";
this->label1->Size = System:
rawing:
ize(83, 13);
this->label1->TabIndex = 2;
this->label1->Text = L"Material of Plate";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System:
rawing:
oint(30, 65);
this->label2->Name = L"label2";
this->label2->Size = System:
rawing:
ize(95, 13);
this->label2->TabIndex = 3;
this->label2->Text = L"Thickness of Plate";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System:
rawing:
oint(219, 65);
this->label4->Name = L"label4";
this->label4->Size = System:
rawing:
ize(23, 13);
this->label4->TabIndex = 5;
this->label4->Text = L"mm";
//
// Form1
//
this->AutoScaleDimensions = System:
rawing:
izeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System:
rawing:
ize(287, 138);
this->Controls->Add(this->label4);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->comboBox2);
this->Controls->Add(this->comboBox1);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
};
}
Here is what i need:
Combobox1 - Material of Plate:
Choice: Metal or Plastic
Combobox2 - Thickness of Plate:
Choice: if Metal in Combobox1: 2,3,4,5,6
Choice: if Plastic in Combobox1: 8,10,15
I am unable to solve the problem, can any one help me out with the this!...any help is highly appreciated...!
The code is as follows:
#pragma once
namespace Program {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:
ata;using namespace System:
rawing;/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </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::ComboBox^ comboBox1;
protected:
private: System::Windows::Forms::ComboBox^ comboBox2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label4;
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->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// comboBox1
//
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^ >(2) {L"Metal", L"Plastic"});
this->comboBox1->Location = System:
rawing:
oint(142, 34);this->comboBox1->Name = L"comboBox1";
this->comboBox1->Size = System:
rawing:
ize(71, 21);this->comboBox1->TabIndex = 0;
//
// comboBox2
//
this->comboBox2->FormattingEnabled = true;
this->comboBox2->Items->AddRange(gcnew cli::array< System::Object^ >(5) {L"2", L"3", L"4", L"5", L"6"});
this->comboBox2->Location = System:
rawing:
oint(142, 62);this->comboBox2->Name = L"comboBox2";
this->comboBox2->Size = System:
rawing:
ize(71, 21);this->comboBox2->TabIndex = 1;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System:
rawing:
oint(30, 37);this->label1->Name = L"label1";
this->label1->Size = System:
rawing:
ize(83, 13);this->label1->TabIndex = 2;
this->label1->Text = L"Material of Plate";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System:
rawing:
oint(30, 65);this->label2->Name = L"label2";
this->label2->Size = System:
rawing:
ize(95, 13);this->label2->TabIndex = 3;
this->label2->Text = L"Thickness of Plate";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System:
rawing:
oint(219, 65);this->label4->Name = L"label4";
this->label4->Size = System:
rawing:
ize(23, 13);this->label4->TabIndex = 5;
this->label4->Text = L"mm";
//
// Form1
//
this->AutoScaleDimensions = System:
rawing:
izeF(6, 13);this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System:
rawing:
ize(287, 138);this->Controls->Add(this->label4);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->comboBox2);
this->Controls->Add(this->comboBox1);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
};
}
![]() |
Similar Threads
- combobox problems (PHP)
- USB connecting problem (Troubleshooting Dead Machines)
- ComboBox - please help (Visual Basic 4 / 5 / 6)
- ComboBox UpDate Problem (VB.NET)
Other Threads in the C++ Forum
- Previous Thread: Read windows registry in c??
- Next Thread: C++ n-nary tree iteration
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph homeworkhelp iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





