Click here to Skip to main content
15,900,110 members
Home / Discussions / C#
   

C#

 
GeneralRe: GDI Related issue - External Exception being thrown in System.Drawing.dll Pin
BryanWilkins5-Mar-10 11:51
professionalBryanWilkins5-Mar-10 11:51 
GeneralRe: GDI Related issue - External Exception being thrown in System.Drawing.dll [modified] Pin
Eagle325-Mar-10 12:35
Eagle325-Mar-10 12:35 
AnswerRe: GDI Related issue - External Exception being thrown in System.Drawing.dll Pin
Luc Pattyn5-Mar-10 13:35
sitebuilderLuc Pattyn5-Mar-10 13:35 
GeneralRe: GDI Related issue - External Exception being thrown in System.Drawing.dll Pin
Eagle326-Mar-10 0:04
Eagle326-Mar-10 0:04 
GeneralRe: GDI Related issue - External Exception being thrown in System.Drawing.dll Pin
BryanWilkins6-Mar-10 3:55
professionalBryanWilkins6-Mar-10 3:55 
GeneralRe: GDI Related issue - External Exception being thrown in System.Drawing.dll Pin
Eagle3210-Mar-10 11:28
Eagle3210-Mar-10 11:28 
GeneralRe: GDI Related issue - External Exception being thrown in System.Drawing.dll Pin
BryanWilkins10-Mar-10 11:32
professionalBryanWilkins10-Mar-10 11:32 
QuestionDynamic Form Pin
eddieangel5-Mar-10 9:21
eddieangel5-Mar-10 9:21 
I have a button on a form that triggers a pop up (This is a Windows Form App, not an ASP.Net App) to collect additional data based on what the related combobox value was when the button was pressed. This form can have anywhere from 2 to 10 inputs (Radio Buttons, Combo Boxes) on the screen.

The issue is this: I don't want to make 15 forms to accommodate all of the possibilities, so I decided (Or am still deciding) to make a dynamic form that accepts the combobox value as an argument. So parent form has combobox A and sends that value to child form on button press.

First of all I would like to know what you think of the idea of having a dynamic form vs. 15 forms.

Secondly, on the dynamic form idea I decided to create a form with all of the possible elements (5 groupboxes with radio buttons, 5 comboboxes, 1 multiline textbox and 1 save button) and then resize and show / hide / position the controls as necessary based on the input. I can handle this well enough, though it seems laborious, but I am having an issue with dynamically loading information into my comboboxes, see this code:

switch (theId)
           {
               case 24:
                   this.Size = new System.Drawing.Size(348, 619);
                   foreach (Control ctrl in Controls)
                   {
                       ctrl.Visible = true;
                   }
                   break;
               case 25:
                   string[] myControls = new string[4] { "groupBox1", "label1", "comboBox1", "btnSave" };

                   foreach (Control ctrl in Controls)
                   {
                       if (Array.IndexOf(myControls, ctrl.Name) == -1)
                       {
                           ctrl.Visible = false;
                       }
                       else
                       {
                           ctrl.Visible = true;
                           switch (Array.IndexOf(myControls, ctrl.Name))
                           {
                               case 0:
                                   ctrl.Text = "Blah";
                                   break;
                               case 1:
                                   ctrl.Text = "Foo";
                                   break;
                               case 2:
                                   if (ctrl is ComboBox)
                                   {


My breakdown is here at the end, the Control ctrl won't accept the Combobox.Items.Add, so how do I add items to it? And is this whole approach just not right?
AnswerRe: Dynamic Form Pin
BryanWilkins5-Mar-10 9:58
professionalBryanWilkins5-Mar-10 9:58 
AnswerRe: Dynamic Form Pin
MollyTheCoder5-Mar-10 10:11
MollyTheCoder5-Mar-10 10:11 
QuestionHow to: Launch an application and embed it into a dockable window? Pin
Shmulik285-Mar-10 9:06
Shmulik285-Mar-10 9:06 
AnswerRe: How to: Launch an application and embed it into a dockable window? Pin
DaveyM695-Mar-10 9:16
professionalDaveyM695-Mar-10 9:16 
GeneralRe: How to: Launch an application and embed it into a dockable window? Pin
Giorgi Dalakishvili6-Mar-10 2:49
mentorGiorgi Dalakishvili6-Mar-10 2:49 
QuestionDisable DataGridViewTextBoxCell Right Click Menu Pin
potatoe915-Mar-10 8:49
potatoe915-Mar-10 8:49 
QuestionProgram inter-instance communication? Pin
Matthew Klein5-Mar-10 8:00
Matthew Klein5-Mar-10 8:00 
AnswerRe: Program inter-instance communication? Pin
kevinnicol5-Mar-10 8:34
kevinnicol5-Mar-10 8:34 
AnswerRe: Program inter-instance communication? Pin
Matthew Klein5-Mar-10 8:50
Matthew Klein5-Mar-10 8:50 
QuestionHow to access PointInLink() for a LinkLabel [modified] Pin
swo.priv5-Mar-10 7:38
swo.priv5-Mar-10 7:38 
QuestionHow to get the exact File the User Click on?? Pin
Britt Mills5-Mar-10 5:07
Britt Mills5-Mar-10 5:07 
AnswerRe: How to get the exact File the User Click on?? Pin
Luc Pattyn5-Mar-10 5:18
sitebuilderLuc Pattyn5-Mar-10 5:18 
GeneralRe: How to get the exact File the User Click on?? Pin
Britt Mills5-Mar-10 5:28
Britt Mills5-Mar-10 5:28 
GeneralRe: How to get the exact File the User Click on?? Pin
Luc Pattyn5-Mar-10 5:36
sitebuilderLuc Pattyn5-Mar-10 5:36 
GeneralRe: How to get the exact File the User Click on?? Pin
Britt Mills5-Mar-10 6:10
Britt Mills5-Mar-10 6:10 
QuestionVoice Enabled System Pin
amitk_1895-Mar-10 4:55
amitk_1895-Mar-10 4:55 
AnswerRe: Voice Enabled System Pin
Not Active5-Mar-10 5:04
mentorNot Active5-Mar-10 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.