我有两个comboBoxes comboBox1 & comboBox2。我会根据comboBox1的SelectedItem更改comboBox1 & comboBox2的一些属性。我在Form1_Load块中编写了以下代码:
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
if(this->comboBox1->SelectedItem=="Letters"){
this->comboBox1->Size=System::Drawing::Size(238,27);
this->comboBox1->Location=System::Drawing::Point(301,73);
this->comboBox2->Visible= true;
}
else{
this->comboBox1->Size=System::Drawing::Size(473,27);
this->comboBox2->Visible= false;
}
}但是它不起作用!
发布于 2011-10-25 04:30:55
这些代码应该在Form1_Load事件中吗?我认为它应该在combobox1的SelectedIndexChanged事件下。
https://stackoverflow.com/questions/7880952
复制相似问题