Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
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
mve#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 
AnswerRe: Switch-Case sample Pin
#realJSOP24-May-18 3:35
mve#realJSOP24-May-18 3:35 
QuestionHow to insert image into merged cell. (ClosedXML) Pin
Member 1379545720-May-18 14:11
Member 1379545720-May-18 14:11 
SuggestionRe: How to insert image into merged cell. (ClosedXML) Pin
Maciej Los21-May-18 20:41
mveMaciej Los21-May-18 20:41 
QuestionTriggering a cellformatting event of a datagridview Pin
leone19-May-18 10:21
leone19-May-18 10:21 
AnswerRe: Triggering a cellformatting event of a datagridview Pin
Maciej Los21-May-18 20:44
mveMaciej Los21-May-18 20:44 

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.