Click here to Skip to main content
15,913,486 members
Home / Discussions / C#
   

C#

 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 0:21
pekhaleyogesh4-Feb-10 0:21 
AnswerRe: How i implement Strategy Design pattern in following case Pin
Rob Philpott4-Feb-10 0:21
Rob Philpott4-Feb-10 0:21 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 0:25
pekhaleyogesh4-Feb-10 0:25 
AnswerRe: How i implement Strategy Design pattern in following case Pin
Not Active4-Feb-10 1:55
mentorNot Active4-Feb-10 1:55 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 2:21
pekhaleyogesh4-Feb-10 2:21 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 2:30
pekhaleyogesh4-Feb-10 2:30 
GeneralRe: How i implement Strategy Design pattern in following case Pin
Not Active4-Feb-10 2:41
mentorNot Active4-Feb-10 2:41 
Questiontying an event to dynamically created radio buttons [Solved] Pin
Wamuti3-Feb-10 22:38
Wamuti3-Feb-10 22:38 
I have dynamically created sets of radio button in different group boxes to represent possible answers to various questions like below. Now i want after the user has selected the correct answers, and clicks the "Done" button,the application is able to know which answers where selected. I am suspecting that i need an event for this but i do not know how to make such to handle this situation. Please assist.

// Data source for questions and answers
 string[] examsQuestions = { "What does OOP stand for?", 
                                      "Which control can be used in a layout for a form?", 
                                      "Which of the below languaages is not part of the .Net initiative" };
        string[,] answers = { { "Object Oriented Prog", 
                                  "Only Other People", 
                                  "Oportunity Oriented Programming", 
                                  "Only Onntological Possiblities" }, 
                            { "TableLayoutPanel", 
                                "RowLayoutPanel", 
                                "ColumnLayoutPanel", 
                                "GridLayoutControl" }, 
                            { "C#", 
                                "J#", 
                                "K#", 
                                "F#" } 
                            };
        string[] correctAnswer = { "K#"};


// The dynamically created controls to receive the questions and answers:

 private void LoadItems()
        {


            for (int i = 0; i < examsQuestions.Length; i++)
            {
               
                    GroupBox gb = new GroupBox();
                    gb.AutoSize = true;
                    tbp.Controls.Add(gb); // Adding the groupbox to the main table panel added during design time.
                    TableLayoutPanel tbp2 = new TableLayoutPanel();// a panel for the controls inside the group box
                    tbp2.ColumnCount = 1; // ensure that there is only one column in the panel inside the group box

                    gb.Controls.Add(tbp2);// add the panel in the group box
                    // Make the controls (a label and four radiobuttons)i want to use ready
                    Label newLabel = new Label();

                    newLabel.Text = examsQuestions[i].ToString();
                    newLabel.AutoSize = true;

                    RadioButton rdb1 = new RadioButton();
                    rdb1.AutoSize = true;
                    rdb1.Text = answers[i, 0].ToString();

                    RadioButton rdb2 = new RadioButton();
                    rdb2.AutoSize = true;
                    rdb2.Text = answers[i, 1].ToString(); ;

                    RadioButton rdb3 = new RadioButton();
                    rdb3.AutoSize = true;
                    rdb3.Text = answers[i, 2].ToString(); ;

                    RadioButton rdb4 = new RadioButton();
                    rdb4.AutoSize = true;
                    rdb4.Text = answers[i, 3].ToString();
                    Control[] ctrl = { newLabel, rdb1, rdb2, rdb3, rdb4 };
                    tbp2.Controls.AddRange(ctrl);
                
            }
            
        }


Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.

AnswerRe: tying an event to dynamically created radio buttons Pin
Zar Ni3-Feb-10 22:57
Zar Ni3-Feb-10 22:57 
AnswerRe: tying an event to dynamically created radio buttons Pin
Luc Pattyn4-Feb-10 0:14
sitebuilderLuc Pattyn4-Feb-10 0:14 
Questioncreate LogError file(C# Coding) [modified] for WindowsApplication Pin
jojoba20103-Feb-10 22:06
jojoba20103-Feb-10 22:06 
AnswerRe: create LogError file(C# Coding) Pin
Zar Ni3-Feb-10 22:16
Zar Ni3-Feb-10 22:16 
QuestionRe: create LogError file(C# Coding) Pin
jojoba20103-Feb-10 22:38
jojoba20103-Feb-10 22:38 
AnswerRe: create LogError file(C# Coding) Pin
Zar Ni3-Feb-10 22:42
Zar Ni3-Feb-10 22:42 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Wamuti3-Feb-10 23:00
Wamuti3-Feb-10 23:00 
QuestionRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
jojoba20103-Feb-10 23:55
jojoba20103-Feb-10 23:55 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Luc Pattyn4-Feb-10 0:18
sitebuilderLuc Pattyn4-Feb-10 0:18 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Zar Ni4-Feb-10 13:41
Zar Ni4-Feb-10 13:41 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Pr@teek B@h!5-Feb-10 3:37
Pr@teek B@h!5-Feb-10 3:37 
QuestionDatagridview Focus to specific cell Pin
Vijjuuu.3-Feb-10 21:02
Vijjuuu.3-Feb-10 21:02 
AnswerRe: Datagridview Focus to specific cell Pin
Eddy Vluggen3-Feb-10 21:34
professionalEddy Vluggen3-Feb-10 21:34 
GeneralRe: Datagridview Focus to specific cell Pin
Vijjuuu.4-Feb-10 1:11
Vijjuuu.4-Feb-10 1:11 
GeneralRe: Datagridview Focus to specific cell Pin
Eddy Vluggen4-Feb-10 1:32
professionalEddy Vluggen4-Feb-10 1:32 
GeneralRe: Datagridview Focus to specific cell Pin
Vijjuuu.4-Feb-10 2:09
Vijjuuu.4-Feb-10 2:09 
QuestionImage opacity in C# Pin
VCsamir3-Feb-10 20:45
VCsamir3-Feb-10 20:45 

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.