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

C#

 
QuestionHaar Cascade Car Pin
Member 1373868124-May-18 8:11
Member 1373868124-May-18 8:11 
QuestionRe: Haar Cascade Car Pin
Gerry Schmitz24-May-18 10:41
mveGerry Schmitz24-May-18 10:41 
AnswerRe: Haar Cascade Car Pin
OriginalGriff24-May-18 20:02
mveOriginalGriff24-May-18 20:02 
GeneralRe: Haar Cascade Car Pin
Gerry Schmitz25-May-18 7:16
mveGerry Schmitz25-May-18 7:16 
QuestioniTextsharp - Adding radio button image to .pdf Pin
User 1367511422-May-18 22:47
User 1367511422-May-18 22:47 
AnswerRe: iTextsharp - Adding radio button image to .pdf Pin
Richard Deeming23-May-18 1:11
mveRichard Deeming23-May-18 1:11 
GeneralRe: iTextsharp - Adding radio button image to .pdf Pin
User 1367511425-May-18 3:07
User 1367511425-May-18 3:07 
QuestionHow the find and assignment field with DataView type ? Pin
Member 245846722-May-18 17:18
Member 245846722-May-18 17:18 
AnswerRe: How the find and assignment field with DataView type ? Pin
OriginalGriff22-May-18 19:04
mveOriginalGriff22-May-18 19:04 
AnswerRe: How the find and assignment field with DataView type ? Pin
Richard Deeming23-May-18 1:09
mveRichard Deeming23-May-18 1:09 
AnswerRe: How the find and assignment field with DataView type ? Pin
#realJSOP24-May-18 5:17
professional#realJSOP24-May-18 5:17 
QuestionSwitch-Case sample Pin
User 1367511422-May-18 0:31
User 1367511422-May-18 0:31 
AnswerRe: Switch-Case sample Pin
OriginalGriff22-May-18 0:40
mveOriginalGriff22-May-18 0:40 
You can't use switch like that in C#, the format is:
C#
switch (variable)
   {
   case constantValue1:
       ...
       break;
   case constantValue2:
       ...
       break;
   default:
       ...
       break;
   }
You could use a variable to "combine" the radio buttons and the switch on that, but it would be very messy. You would be much better off with an if ... else if ... else instead:
C#
if (radioButton54.Checked)
    {
    Paragraph q1 = new Paragraph(label10.Text + " " + radioButton54.Text);
    pdfDosya.Add(q1);
    }
else if (radioButton122.Checked)
    {
    Paragraph q1 = new Paragraph(label10.Text + " " + radioButton122.Text);
    pdfDosya.Add(q1);
    }
else if (radioButton1.Checked)
    {
    Paragraph q1 = new Paragraph(label10.Text + " " + radioButton1.Text);
    pdfDosya.Add(q1);
    }
In the long term, it'll be a lot more readable and maintainable.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralMessage Closed Pin
22-May-18 0:51
User 1367511422-May-18 0:51 
GeneralRe: Switch-Case sample Pin
OriginalGriff22-May-18 1:01
mveOriginalGriff22-May-18 1:01 
SuggestionRe: Switch-Case sample Pin
Richard Deeming22-May-18 2:16
mveRichard Deeming22-May-18 2:16 
GeneralRe: Switch-Case sample Pin
OriginalGriff22-May-18 2:23
mveOriginalGriff22-May-18 2:23 
GeneralRe: Switch-Case sample Pin
Richard Deeming22-May-18 3:08
mveRichard Deeming22-May-18 3:08 
GeneralRe: Switch-Case sample Pin
OriginalGriff22-May-18 4:19
mveOriginalGriff22-May-18 4:19 
GeneralRe: Switch-Case sample Pin
Dave Kreskowiak22-May-18 4:26
mveDave Kreskowiak22-May-18 4:26 
GeneralRe: Switch-Case sample Pin
OriginalGriff22-May-18 5:37
mveOriginalGriff22-May-18 5:37 
GeneralRe: Switch-Case sample Pin
Mycroft Holmes22-May-18 14:13
professionalMycroft Holmes22-May-18 14:13 
AnswerRe: Switch-Case sample Pin
OriginalGriff22-May-18 22:59
mveOriginalGriff22-May-18 22:59 
GeneralRe: Switch-Case sample Pin
User 1367511422-May-18 23:23
User 1367511422-May-18 23:23 
GeneralRe: Switch-Case sample Pin
Pete O'Hanlon22-May-18 23:40
mvePete O'Hanlon22-May-18 23:40 

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.