TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Blake Arnold
NA
30
0
Simplify Loop
Nov 15 2007 3:40 PM
I have this piece of code that i would like to simplify because I know that i will be adding more checkboxes in the future. Can any one help me to simplify this? Also, I already declared the string strSubscription in above code.
//Assign database name to strings
if (chbAll1t60.Checked == true)
{
strSubscription += "xXpoOFAd";
if (chbAll60t70.Checked == true)
{
strSubscription += ":wE9z4HjJ";
}
else
{
if (chbHor1t60.Checked == true)
{
strSubscription += ":yRczF320";
}
else
{
if (chbHor60t70.Checked == true)
{
strSubscription += ":8qz1ExKb";
}
}
}
}
else
{
if (chbAll60t70.Checked == true)
{
strSubscription += "wE9z4HjJ";
if (chbHor1t60.Checked == true)
{
strSubscription += ":yRczF320";
}
else
{
if (chbHor60t70.Checked == true)
{
strSubscription += ":8qz1ExKb";
}
}
}
else
{
if (chbHor1t60.Checked == true)
{
strSubscription += "yRczF320";
if (chbHor60t70.Checked == true)
{
strSubscription += ":8qz1ExKb";
}
}
else
{
if (chbHor60t70.Checked == true)
{
strSubscription += "8qz1ExKb";
}
}
}
}
Reply
Answers (
4
)
C#- Project with DLLs
create "control"