Problems with Dialog Controls in VS2003
-
Hi All, I'm working on my first project in VS 2003 (coming from 6.0), and have run into a snag while creating a simple dialog. The problem is this. I am building a CAD application with MFC, and needed a dialog to manage the creation of one of the primitives. Simple enough.. I placed 2 radio buttons on the form (along with other controls), and then began assigning variables to the controls. The problem arose when the class wizard would not display any of the control ID's for the radio buttons. So, I tried to add the variable relations in by using DDX_Radio(). The program would give me a runtime error at that point that I couldn't track down. After troubleshooting for about an hour, I decided to place a CComboBox in instead since I could essentially track/manage the variable just as easily. After assigning a variable to the combo box, I went to fill it using AddString in the OnInitDialog() function. The problem is that the combobox doesn't drop. I can't see a way to manipulate it in the resource editor, and this has consumed and insane amount of time for such a simple task. I've never had a problem with this in VS 6.0, and it's a bit confusing. Here's the code in my InitDialog (m_typeBox is the CComboBox control):
BOOL CTerminalPrompt::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_Elements = 1; m_typeBox.AddString("testing"); m_typeBox.AddString("testing2"); this->UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
Does anyone have any suggestions? Am I missing something? Thanks, your help is a GREATLY appreciated :-D -
Hi All, I'm working on my first project in VS 2003 (coming from 6.0), and have run into a snag while creating a simple dialog. The problem is this. I am building a CAD application with MFC, and needed a dialog to manage the creation of one of the primitives. Simple enough.. I placed 2 radio buttons on the form (along with other controls), and then began assigning variables to the controls. The problem arose when the class wizard would not display any of the control ID's for the radio buttons. So, I tried to add the variable relations in by using DDX_Radio(). The program would give me a runtime error at that point that I couldn't track down. After troubleshooting for about an hour, I decided to place a CComboBox in instead since I could essentially track/manage the variable just as easily. After assigning a variable to the combo box, I went to fill it using AddString in the OnInitDialog() function. The problem is that the combobox doesn't drop. I can't see a way to manipulate it in the resource editor, and this has consumed and insane amount of time for such a simple task. I've never had a problem with this in VS 6.0, and it's a bit confusing. Here's the code in my InitDialog (m_typeBox is the CComboBox control):
BOOL CTerminalPrompt::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_Elements = 1; m_typeBox.AddString("testing"); m_typeBox.AddString("testing2"); this->UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
Does anyone have any suggestions? Am I missing something? Thanks, your help is a GREATLY appreciated :-DOne thing off the top of my head. Make sure that the combobox is big enough to display the dropdown. It may be showing the dropdown but the control isn't big enough for you to see it. There appears to be two sizes for the combo. One size is what you see and the other is with the dropdown. At least, that's how I look at it. Artificial intelligence is no match for natural stupidity. Never argue with an idiot. They will drag you down to their level where they are an expert.
-
One thing off the top of my head. Make sure that the combobox is big enough to display the dropdown. It may be showing the dropdown but the control isn't big enough for you to see it. There appears to be two sizes for the combo. One size is what you see and the other is with the dropdown. At least, that's how I look at it. Artificial intelligence is no match for natural stupidity. Never argue with an idiot. They will drag you down to their level where they are an expert.
-
One thing off the top of my head. Make sure that the combobox is big enough to display the dropdown. It may be showing the dropdown but the control isn't big enough for you to see it. There appears to be two sizes for the combo. One size is what you see and the other is with the dropdown. At least, that's how I look at it. Artificial intelligence is no match for natural stupidity. Never argue with an idiot. They will drag you down to their level where they are an expert.
Ahh, found in another recently posted thread.. I needed to click the 'down button' in the resource editor, and then it will allow me to resize the display rect, but only after clicking on the down button. Weird. I don't remember that:confused: . Oh well, thanks for your help Anon
-
Ahh, found in another recently posted thread.. I needed to click the 'down button' in the resource editor, and then it will allow me to resize the display rect, but only after clicking on the down button. Weird. I don't remember that:confused: . Oh well, thanks for your help Anon